|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore
Similar in concept to the AbstractSingleStore, except this houses multiple instances of 'singletons'.
Nested Class Summary | |
static class |
AbstractMultipleStore.AllowMultiplesAction
|
Constructor Summary | |
AbstractMultipleStore(java.lang.Class instanceOf,
AbstractMultipleStore.AllowMultiplesAction ama)
Constructor specifying all the parameters for using a singleton in this framework. |
Method Summary | |
protected abstract void |
addDefaultSingletons()
Adds the default inner singletons, which is an implementation specific method. |
void |
addSingleton(java.lang.Object singleton)
Sets the singleton. |
java.util.Enumeration |
getSingletons()
Returns the current inner singletons. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final AbstractMultipleStore.AllowMultiplesAction NO_MULTIPLES_ERROR
public static final AbstractMultipleStore.AllowMultiplesAction NO_MULTIPLES_SILENT
public static final AbstractMultipleStore.AllowMultiplesAction MULTIPLES_OK
Constructor Detail |
public AbstractMultipleStore(java.lang.Class instanceOf, AbstractMultipleStore.AllowMultiplesAction ama)
instanceOf
- singletons must be of this class.ama
- true if this store should allow
multiple instances of the exact same class, or false
if it should prevent multiple instances sharing the exact
same class. This helps to enforce the idea of 'singleton'.Method Detail |
public java.util.Enumeration getSingletons()
IllegalStateException
- if no singleton was created.public void addSingleton(java.lang.Object singleton)
singleton
- the singleton to set.
IllegalArgumentException
- if singleton is
null, or is not of the correct type.protected abstract void addDefaultSingletons()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |