|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.agent.state.impl.AgentState
public abstract class AgentState
Wrapper for the AgentState adding additional String information that provides more details about the agent state.
WARNING: equals() defined according to it'description as well only!
Note that we can not assume which state the agent may find itself in, so we will use a Java object hierarchy to represent it. We provide a set of interfaces that may extend each other to provide the information about the state, e.g. the state may be only but we may create also interface that extends thus allowing other objects to know, that means that agent is healthy because that is what state declares.
Constructor Summary | |
---|---|
AgentState(java.lang.String description)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getDescription()
Additional information about the state - this is inlcuded to hashCode() and equals() methods. |
boolean |
isNotState(java.lang.Class... states)
Provides convenient method for testing whether the agent is not in any of 'states'. |
boolean |
isState(java.lang.Class... states)
Provides convenient method for testing whether the agent is in one of 'states'. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AgentState(java.lang.String description)
Method Detail |
---|
public boolean isState(java.lang.Class... states)
IAgentState
Returns whether this state is one of the 'states' (using instanceof).
isState
in interface IAgentState
public boolean isNotState(java.lang.Class... states)
IAgentState
Returns whether this state is not any of the 'states' (using instanceof).
isNotState
in interface IAgentState
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String getDescription()
IAgentState
getDescription
in interface IAgentState
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |