| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.basher.impl.InMemoryEntityRegistry
public class InMemoryEntityRegistry
| Constructor Summary | |
|---|---|
| InMemoryEntityRegistry() | |
| Method Summary | |
|---|---|
|  Collection | getAllRegistered(String entityIdentifier)Retrieves all registered entityinstances for a particularentityIdentifier. | 
|  long | getNumRegistered(String entityIdentifier)Retrieves the number of entityinstances registered for the specifiedentityIdentifier. | 
|  Object | getRandom(String entityIdentifier)Retrieves a random entityinstance registered for the specifiedentityIdentifier. | 
|  Collection | getRandomSelection(String entityIdentifier,
                   int size)Retrieves a randomly sized collection of entityinstances registered for the specifiedentityIdentifier. | 
|  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 EntityRegistryentityIdentifier - The entity type to remove.entity - The entity to remove
public void register(String entityIdentifier,
                     Object entity)
EntityRegistryentityIdentifier is a key into a collection
 of entity instances being held by the EntityRegistry.
register in interface EntityRegistryentityIdentifier - The type of the entity being registeredentity - The entity being registeredpublic Collection getAllRegistered(String entityIdentifier)
EntityRegistryentity instances for a particular entityIdentifier.
getAllRegistered in interface EntityRegistryentityIdentifier - The entity type to retrive the entity instances for
entity.public long getNumRegistered(String entityIdentifier)
EntityRegistryentity instances registered for the specified entityIdentifier.
getNumRegistered in interface EntityRegistryentityIdentifier - The entity type to count
entityIdentifier.
public Collection getRandomSelection(String entityIdentifier,
                                     int size)
EntityRegistryentity instances registered for the specified
 entityIdentifier.
getRandomSelection in interface EntityRegistryentityIdentifier - 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)
EntityRegistryentity instance registered for the specified entityIdentifier.
getRandom in interface EntityRegistryentityIdentifier - The entity type to retrieve the instance for.
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||