org.pietschy.command
Class RemoveVisitor

java.lang.Object
  extended by org.pietschy.command.AbstractVisitor
      extended by org.pietschy.command.RemoveVisitor
All Implemented Interfaces:
GroupVisitor

public class RemoveVisitor
extends AbstractVisitor

This command will traverse a group heirarchy and remove the specified command.

Version:
$Revision: 1.6 $
Author:
andrewp

Nested Class Summary
 
Nested classes/interfaces inherited from class org.pietschy.command.AbstractVisitor
AbstractVisitor.VisitMode
 
Field Summary
 
Fields inherited from class org.pietschy.command.AbstractVisitor
DEEP, mode, SHALLOW
 
Constructor Summary
RemoveVisitor(Command removeCommand)
          Constructs an new RemoveVisitor that will deeply traverse the group and all its child groups.
RemoveVisitor(Command removeCommand, AbstractVisitor.VisitMode mode)
          Constructs an new RemoveVisitor that will traverse the group according the to visit mode.
 
Method Summary
 void visit(ActionCommand command)
          Called to visit a ActionCommand member of a CommandGroup.
 void visit(CommandGroup group)
          Called to visit a CommandGroup member of a CommandGroup.
 
Methods inherited from class org.pietschy.command.AbstractVisitor
conditionallyVisitChildren, isParentGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveVisitor

public RemoveVisitor(Command removeCommand)
Constructs an new RemoveVisitor that will deeply traverse the group and all its child groups.

Parameters:
removeCommand - the command to removed.

RemoveVisitor

public RemoveVisitor(Command removeCommand,
                     AbstractVisitor.VisitMode mode)
Constructs an new RemoveVisitor that will traverse the group according the to visit mode.

Parameters:
removeCommand - the command to removed.
mode - the mode in which to visit the parent group, either AbstractVisitor.DEEP or AbstractVisitor.SHALLOW.
Method Detail

visit

public void visit(ActionCommand command)
Description copied from interface: GroupVisitor
Called to visit a ActionCommand member of a CommandGroup.

Parameters:
command - the member being visited.

visit

public void visit(CommandGroup group)
Description copied from interface: GroupVisitor
Called to visit a CommandGroup member of a CommandGroup.

Parameters:
group - the member being visited.