|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ca.quine.factorygen.Registrar
Registers a set of IRegistrant objects, which know how to register themselves.
IRegistrant
Constructor Summary | |
Registrar()
|
Method Summary | |
protected void |
addRegistrant(IRegistrant registrant)
Subclasses can call this method to add an IRegistrant to the registered list of handlers. |
Iterator |
getRegistrantEntryIterator()
Returns an Iterator over all the map entries. |
Iterator |
getRegistrantIterator()
Returns an Iterator that iterates over all the
IRegistrant instances registered with this
Registrar , possibly with duplicates if an
IRegistrant is registered with more than one key. |
protected IRegistrant |
getRegistrantProtected(Object key)
Returns the IRegistrant that can handle the given key , or
null if no such handler is found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Registrar()
Method Detail |
protected void addRegistrant(IRegistrant registrant)
registrant
- protected IRegistrant getRegistrantProtected(Object key)
key
, or
null
if no such handler is found. Subclasses of Registrar
will call this internal method and cast the returned IRegistrant to the
correct type.
key
-
public Iterator getRegistrantEntryIterator()
Registrar
has.
public Iterator getRegistrantIterator()
Iterator
that iterates over all the
IRegistrant
instances registered with this
Registrar
, possibly with duplicates if an
IRegistrant
is registered with more than one key.
This method can be used to implement the Chain of Responsibility
pattern.
IRegistrant
instances
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |