|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ascape.model.AscapeObject org.ascape.model.rule.Rule org.ascape.model.rule.SearchRule
public class SearchRule
A rule that can be used to search through a collection of agents.
Field Summary | |
---|---|
static int |
SEARCH_EQUAL
The symbol for an 'equals' search. |
static int |
SEARCH_MAX
The symbol for a 'maximum' search. |
static int |
SEARCH_MIN
The symbol for a 'minimum' search. |
Fields inherited from class org.ascape.model.AscapeObject |
---|
ARBITRARY_SEED, name, scape |
Constructor Summary | |
---|---|
SearchRule(java.lang.String name)
Constructs a search rule with the providied name. |
Method Summary | |
---|---|
void |
clear()
Clears the found result. |
void |
execute(Agent agent)
Perform the search rule for the specified agent. |
java.util.Comparator |
getComparator()
Returns the comparator used for this search. |
Agent |
getFoundAgent()
Gets the found agent. |
java.lang.Object |
getKey()
Returns the key used for this search. |
int |
getType()
Returns the search type used in any searches using this rule. |
boolean |
isRandom()
In geneeral, the search in general does not need to be random. |
void |
setComparator(java.util.Comparator comparator)
Sets the comparator for the search. |
void |
setKey(java.lang.Object key)
Sets the key for the search. |
void |
setSearchType(int type)
Sets the search type to be used for this search. |
Methods inherited from class org.ascape.model.rule.Rule |
---|
getScape, isCauseRemoval, isIterateAll, isRandomExecution, setScape |
Methods inherited from class org.ascape.model.AscapeObject |
---|
clone, diffDeep, diffDeep, diffDeepBFS, diffDeepDFS, diffDeepValidate, diffDeepVisit, equalsDeep, equalsDeep, equalsDeep, getComparisonStream, getName, getRandom, getRandomSeed, randomInRange, randomInRange, randomIs, randomToLimit, reseed, setComparisonStream, setName, setRandom, setRandomSeed, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SEARCH_EQUAL
public static final int SEARCH_MIN
public static final int SEARCH_MAX
Constructor Detail |
---|
public SearchRule(java.lang.String name)
name
- the name of this objectMethod Detail |
---|
public void execute(Agent agent)
execute
in class Rule
agent
- the target agent.public void clear()
public boolean isRandom()
public java.util.Comparator getComparator()
public void setComparator(java.util.Comparator comparator)
comparator
- the compartor to use for the search.public java.lang.Object getKey()
public void setKey(java.lang.Object key)
key
- the compartor to use for the search.public Agent getFoundAgent()
public void setSearchType(int type)
type
- one of the "SEARCH" symbols specified above.public int getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |