|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--anthill.antsim.impl.RandomResourceSet
RandomResourceSet
is a simple implementation of ResourceSet
which generates RandomResource
s. Each random resource has a generic
name, which is the string representing a random long value. Requests are obtained
by selecting randomly one of the resources stored in this ResourceSet
and by returning the string containing the resource name.
Field Summary | |
protected Factory |
factory
Factory used to instantiate objects |
static java.lang.String |
RANDOM_RESOURCESET_SIZE
Random generator |
protected Resource[] |
resources
Resources contained in this resource set |
protected int |
size
Number of resources contained in this resource set |
Constructor Summary | |
RandomResourceSet(Factory factory)
Initializes this RandomResourceSet by creating
size resources. |
Method Summary | |
void |
clear()
Restores the object to its initial state. |
java.lang.Object |
getRequest()
Generate a random request. |
Resource[] |
getResources()
Return an array containing the resources generated and stored in this ResourceSet . |
int |
size()
Return the number of resources generated and stored in this ResourceSet . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String RANDOM_RESOURCESET_SIZE
protected Factory factory
protected int size
protected Resource[] resources
Constructor Detail |
public RandomResourceSet(Factory factory)
RandomResourceSet
by creating
size
resources.Method Detail |
public void clear()
clear
in interface Clearable
public int size()
ResourceSet
.size
in interface ResourceSet
public Resource[] getResources()
ResourceSet
.getResources
in interface ResourceSet
public java.lang.Object getRequest()
ResourceSet
,
or a more specific request (for example, a free query based on
keywords, or an insert request).getRequest
in interface ResourceSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |