com.pietschy.command
Class SelfOrParentSearchStrategy

java.lang.Object
  extended by com.pietschy.command.SelfOrParentSearchStrategy
All Implemented Interfaces:
CommandContainerSearchStrategy

 class SelfOrParentSearchStrategy
extends java.lang.Object
implements CommandContainerSearchStrategy

Search strategy that traverses a container and all its parents.


Constructor Summary
SelfOrParentSearchStrategy()
           
 
Method Summary
 Command search(java.lang.String id, CommandContainer container)
          Searches the container and all it's parents for the command with the specified id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelfOrParentSearchStrategy

SelfOrParentSearchStrategy()
Method Detail

search

public Command search(java.lang.String id,
                      CommandContainer container)
Searches the container and all it's parents for the command with the specified id.

Specified by:
search in interface CommandContainerSearchStrategy
Parameters:
id - the command to find.
container - the container to search
Returns:
the command if found, or null otherwise.


Copyright © 2006 - 2007 Andrew Pietsch