|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.chain.impl.CatalogBase
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. |
Fields inherited from interface org.apache.commons.chain.Catalog |
CATALOG_KEY |
Constructor Summary | |
CatalogBase()
|
Method Summary | |
void |
addCommand(String name,
Command command)
Add a new name and associated Command or Chain
to the set of named commands known to this Catalog ,
replacing any previous command for that name. |
Command |
getCommand(String name)
Return the Command or Chain associated with the
specified name, if any; otherwise, return null . |
Iterator |
getNames()
Return an Iterator over the set of named commands
known to this Catalog . |
String |
toString()
Converts this Catalog to a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Map commands
The map of named Command
s, keyed by name.
Constructor Detail |
public CatalogBase()
Method Detail |
public void addCommand(String name, Command command)
Catalog
Add a new name and associated Command
or Chain
to the set of named commands known to this Catalog
,
replacing any previous command for that name.
addCommand
in interface Catalog
name
- Name of the new commandcommand
- Command
or Chain
to be returned
for later lookups on this namepublic Command getCommand(String name)
Catalog
Return the Command
or Chain
associated with the
specified name, if any; otherwise, return null
.
getCommand
in interface Catalog
name
- Name for which a Command
or Chain
should be retrievedpublic Iterator getNames()
Catalog
Return an Iterator
over the set of named commands
known to this Catalog
. If there are no known commands,
an empty Iterator is returned.
getNames
in interface Catalog
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |