Building Parsers with Java

sjm.examples.sling
Class AssignFunctionCommand

java.lang.Object
  |
  +--sjm.imperative.Command
        |
        +--sjm.examples.sling.AssignFunctionCommand

public class AssignFunctionCommand
extends Command

This command, when executed, evaluates a function and sets it as the value of a variable.


Field Summary
protected  SlingFunction f
           
protected  Variable v
           
 
Constructor Summary
AssignFunctionCommand(Variable v, SlingFunction f)
          Construct a command to assign the supplied function to the supplied variable.
 
Method Summary
 void execute()
          Evaluate the function and assign the resulting, new function as the value of this object's variable.
 java.lang.String toString()
          Returns a string description of this command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

v

protected Variable v

f

protected SlingFunction f
Constructor Detail

AssignFunctionCommand

public AssignFunctionCommand(Variable v,
                             SlingFunction f)
Construct a command to assign the supplied function to the supplied variable.
Parameters:
Variable - the variable to assign to
SlingFunction - the function to evaluate and assign to the variable at execution time
Method Detail

execute

public void execute()
Evaluate the function and assign the resulting, new function as the value of this object's variable.
Overrides:
execute in class Command

toString

public java.lang.String toString()
Returns a string description of this command.
Overrides:
toString in class java.lang.Object
Returns:
a string description of this command

by Steve Metsker