|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limitless.nmc.Client.AvailableMuCollection
public class AvailableMuCollection
This class represents only the names of MUs as established in an external index.
This class is meant to be used basically as a cache. As such, it can be told to discard it's current values. The next time it's hit, it will reload them.
The reload mechanism is done by the Template Method (or Hollywood) pattern. This class expects to be derived from, and the derived class will carry out the protected reloadNames() on demand. There's no means to add manual entries to this; all work is done by the appropriate derived class. Since this is a singleton, the creation of the derived class object causes the useless base-class object to be discarded.
| Field Summary | |
|---|---|
private static AvailableMuCollection |
instance
This holds the current object that does the work. |
(package private) static org.apache.log4j.Logger |
logger
Log4J Logger |
private java.util.Set |
muNames
This holds the list of strings that are the MU names. |
private java.util.Set |
readOnlyMuNames
This holds an unmodifiable version, suitable for handing to external users without risk of corruption. |
private boolean |
reloadNextHit
This goes true if the collection requires a load of entries. |
| Constructor Summary | |
|---|---|
protected |
AvailableMuCollection()
This makes clear that only derived classes should create these. |
| Method Summary | |
|---|---|
protected void |
addMuName(java.lang.String name)
This allows the derived class to add an entry. |
void |
discard()
This causes the object to throw away all that's stored. |
java.util.Set |
getNames()
This provides access to the set to outside users. |
static AvailableMuCollection |
Instance()
This requests the current worker object. |
private void |
reload()
This is the template-method which calles reloadNames() when it's ready for the derived class to reload. |
protected void |
reloadNames()
This causes the set to be re-populated by the derived class. |
protected void |
setInstance(AvailableMuCollection n)
This allows the derived class to "set" its new object as the current object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static org.apache.log4j.Logger logger
private static AvailableMuCollection instance
private boolean reloadNextHit
private java.util.Set muNames
private java.util.Set readOnlyMuNames
| Constructor Detail |
|---|
protected AvailableMuCollection()
| Method Detail |
|---|
public static AvailableMuCollection Instance()
public void discard()
public java.util.Set getNames()
protected void reloadNames()
protected void setInstance(AvailableMuCollection n)
protected void addMuName(java.lang.String name)
private void reload()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||