|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityRegistry
Simple registry where tasks may store objects to be used during runtime. Warning: This is currenly backed by an in-memory store, which means that heavy use of this may cause a degradation in performance over time.
Method Summary | |
---|---|
Collection |
getAllRegistered(String entityIdentifier)
Retrieves all registered entity instances for a particular entityIdentifier . |
long |
getNumRegistered(String entityIdentifier)
Retrieves the number of entity instances registered for the specified entityIdentifier . |
Object |
getRandom(String entityIdentifier)
Retrieves a random entity instance registered for the specified entityIdentifier . |
Collection |
getRandomSelection(String entityIdentifier,
int maxSize)
Retrieves a randomly sized collection of entity instances registered for the specified
entityIdentifier . |
void |
register(String entityIdentifier,
Object entity)
Register a certain type as having been created. |
void |
unregister(String entityIdentifier,
Object entity)
Removes the specified entity from the registry. |
Method Detail |
---|
void register(String entityIdentifier, Object entity)
entityIdentifier
is a key into a collection
of entity
instances being held by the EntityRegistry
.
entityIdentifier
- The type of the entity being registeredentity
- The entity being registeredCollection getAllRegistered(String entityIdentifier)
entity
instances for a particular entityIdentifier
.
entityIdentifier
- The entity type to retrive the entity instances for
entity
.long getNumRegistered(String entityIdentifier)
entity
instances registered for the specified entityIdentifier
.
entityIdentifier
- The entity type to count
entityIdentifier
.Collection getRandomSelection(String entityIdentifier, int maxSize)
entity
instances registered for the specified
entityIdentifier
.
entityIdentifier
- The entity type to generate the random selection frommaxSize
- The maximum number of entity instances in the collection.
entity
instances. The size of this collection may be less than
the maxSize specified if there are less entity instances registered than is requested.Object getRandom(String entityIdentifier)
entity
instance registered for the specified entityIdentifier
.
entityIdentifier
- The entity type to retrieve the instance for.
void unregister(String entityIdentifier, Object entity)
entityIdentifier
- The entity type to remove.entity
- The entity to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |