|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.chain.impl.CatalogBase
public class 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 java.util.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(java.lang.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(java.lang.String name)
Return the Command or Chain associated with the
specified name, if any; otherwise, return null . |
java.util.Iterator |
getNames()
Return an Iterator over the set of named commands
known to this Catalog . |
java.lang.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 java.util.Map commands
The map of named Command
s, keyed by name.
Constructor Detail |
---|
public CatalogBase()
Method Detail |
---|
public void addCommand(java.lang.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(java.lang.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 java.util.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 java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |