public static class AbstractLookup.Content extends Object implements Serializable
AbstractLookup
to
control its content (a kind of
Privileged API
giving creator of the lookup more rights than subsequent users of the lookup).
Typical usage: AbstractLookup.Content
ic = newInstanceContent()
;Lookup
lookup = newAbstractLookup(ic)
;ic.addPair(...)
;
Constructor and Description |
---|
Content()
Default constructor.
|
Content(Executor notifyIn)
Creates a content associated with an executor to handle dispatch
of changes.
|
Modifier and Type | Method and Description |
---|---|
void |
addPair(AbstractLookup.Pair<?> pair)
The method to add a pair to the associated
AbstractLookup . |
void |
removePair(AbstractLookup.Pair<?> pair)
Remove instance.
|
void |
setPairs(Collection<? extends AbstractLookup.Pair> c)
Changes all pairs in the lookup to new values.
|
public Content()
public Content(Executor notifyIn)
notifyIn
- the executor to notify changes inpublic final void addPair(AbstractLookup.Pair<?> pair)
AbstractLookup
.
Preferably call this method when lookup is already associated with
this content (association is done by passing this object to some
AbstractLookup's constructor
once).pair
- class/instance pairNullPointerException
- may throw NullPointerException if called
before association with AbstractLookup
public final void removePair(AbstractLookup.Pair<?> pair)
pair
- class/instance pairpublic final void setPairs(Collection<? extends AbstractLookup.Pair> c)
c
- the collection of (Pair) objects