Building Parsers with Java

sjm.examples.sling
Class AddFunctionCommand

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

public class AddFunctionCommand
extends Command

This command, when executed, evaluates a renderable function and adds it to a renderable collection.


Field Summary
protected  SlingFunction f
           
protected  Variable nLine
           
protected  RenderableCollection renderables
           
 
Constructor Summary
AddFunctionCommand(RenderableCollection renderables, SlingFunction f, Variable nLine)
          Construct a command to add the supplied function to the supplied function collection.
 
Method Summary
 void execute()
          Evaluate the function and add it to the collection.
 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

renderables

protected RenderableCollection renderables

f

protected SlingFunction f

nLine

protected Variable nLine
Constructor Detail

AddFunctionCommand

public AddFunctionCommand(RenderableCollection renderables,
                          SlingFunction f,
                          Variable nLine)
Construct a command to add the supplied function to the supplied function collection.
Parameters:
RenderableCollection - the collection
SlingFunction - the function to evaluate and add at execution time
nLine - a varialbe representing the number of lines to plot when rendering the function
Method Detail

execute

public void execute()
Evaluate the function and add it to the collection.
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