Building Parsers with Java

sjm.imperative
Class NullCommand

java.lang.Object
  |
  +--sjm.imperative.Command
        |
        +--sjm.imperative.NullCommand

public class NullCommand
extends Command

This command does nothing, which can simplify coding in some cases. For example, an "if" command with no given "else" uses a NullCommand for its else command.


Constructor Summary
NullCommand()
           
 
Method Summary
 void execute()
          Does nothing.
 java.lang.String toString()
          Returns a string description of this null command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullCommand

public NullCommand()
Method Detail

execute

public void execute()
Does nothing.
Overrides:
execute in class Command

toString

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

by Steve Metsker