| java.lang.Object org.apache.commons.chain.impl.CatalogBase
CatalogBase | public class CatalogBase implements Catalog(Code) | | Simple in-memory implementation of
Catalog . This class can
also be used as the basis for more advanced implementations.
This implementation is thread-safe.
author: Craig R. McClanahan author: Matthew J. Sgarlata version: $Revision: 411876 $ $Date: 2006-06-05 19:02:19 +0100 (Mon, 05 Jun 2006) $ |
Constructor Summary | |
public | CatalogBase() Create an empty catalog. | public | CatalogBase(Map commands) Create a catalog whose commands are those specified in the given Map . |
CatalogBase | public CatalogBase()(Code) | | Create an empty catalog.
|
CatalogBase | public CatalogBase(Map commands)(Code) | | Create a catalog whose commands are those specified in the given Map .
All Map keys should be String and all values should be Command .
Parameters: commands - Map of Commands. since: Chain 1.1 |
addCommand | public void addCommand(String name, Command command)(Code) | | Add a new name and associated
Command to the set of named commands known to this
Catalog ,
replacing any previous command for that name.
Parameters: name - Name of the new command Parameters: command - Command to be returnedfor later lookups on this name |
getCommand | public Command getCommand(String name)(Code) | | Return the
Command associated with the
specified name, if any; otherwise, return null .
Parameters: name - Name for which a Commandshould be retrieved The Command associated with the specified name. |
getNames | public Iterator getNames()(Code) | | Return an Iterator over the set of named commands
known to this
Catalog . If there are no known commands,
an empty Iterator is returned.
An iterator of the names in this Catalog. |
toString | public String toString()(Code) | | Converts this Catalog to a String. Useful for debugging purposes.
a representation of this catalog as a String |
|
|