Save This Page
Home » commons-chain-1.2-src » org.apache.commons » chain » impl » [javadoc | source]
org.apache.commons.chain.impl
public class: CatalogBase [javadoc | source]
java.lang.Object
   org.apache.commons.chain.impl.CatalogBase

All Implemented Interfaces:
    Catalog

Simple in-memory implementation of Catalog . This class can also be used as the basis for more advanced implementations.

This implementation is thread-safe.

Field Summary
protected  Map commands   

The map of named Command s, keyed by name. 

Constructor:
 public CatalogBase() 
 public CatalogBase(Map commands) 

    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
Method from org.apache.commons.chain.impl.CatalogBase Summary:
addCommand,   getCommand,   getNames,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.chain.impl.CatalogBase Detail:
 public  void addCommand(String name,
    Command command) 

    Add a new name and associated Command to the set of named commands known to this Catalog , replacing any previous command for that name.

 public Command getCommand(String name) 

    Return the Command associated with the specified name, if any; otherwise, return null.

 public Iterator getNames() 

    Return an Iterator over the set of named commands known to this Catalog . If there are no known commands, an empty Iterator is returned.

 public String toString() 
    Converts this Catalog to a String. Useful for debugging purposes.