|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.basher.impl.InMemoryEntityRegistry
public class InMemoryEntityRegistry
Constructor Summary | |
---|---|
InMemoryEntityRegistry()
|
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 size)
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 |
setLog(org.apache.commons.logging.Log logger)
|
void |
setRandomizer(Randomizer randomizer)
|
void |
unregister(String entityIdentifier,
Object entity)
Removes the specified entity from the registry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InMemoryEntityRegistry()
Method Detail |
---|
public void setLog(org.apache.commons.logging.Log logger)
public void setRandomizer(Randomizer randomizer)
public void unregister(String entityIdentifier, Object entity)
EntityRegistry
unregister
in interface EntityRegistry
entityIdentifier
- The entity type to remove.entity
- The entity to removepublic void register(String entityIdentifier, Object entity)
EntityRegistry
entityIdentifier
is a key into a collection
of entity
instances being held by the EntityRegistry
.
register
in interface EntityRegistry
entityIdentifier
- The type of the entity being registeredentity
- The entity being registeredpublic Collection getAllRegistered(String entityIdentifier)
EntityRegistry
entity
instances for a particular entityIdentifier
.
getAllRegistered
in interface EntityRegistry
entityIdentifier
- The entity type to retrive the entity instances for
entity
.public long getNumRegistered(String entityIdentifier)
EntityRegistry
entity
instances registered for the specified entityIdentifier
.
getNumRegistered
in interface EntityRegistry
entityIdentifier
- The entity type to count
entityIdentifier
.public Collection getRandomSelection(String entityIdentifier, int size)
EntityRegistry
entity
instances registered for the specified
entityIdentifier
.
getRandomSelection
in interface EntityRegistry
entityIdentifier
- The entity type to generate the random selection fromsize
- 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.public Object getRandom(String entityIdentifier)
EntityRegistry
entity
instance registered for the specified entityIdentifier
.
getRandom
in interface EntityRegistry
entityIdentifier
- The entity type to retrieve the instance for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |