agentland.behavior
Class BehaviorID
java.lang.Object
|
+--agentland.behavior.BehaviorID
- All Implemented Interfaces:
- Serializable
- public class BehaviorID
- extends Object
- implements Serializable
- See Also:
- Serialized Form
BehaviorID
public BehaviorID(AgentID ag)
getNumeric
public Integer getNumeric()
setNumeric
public void setNumeric(Integer num)
getAgentID
public AgentID getAgentID()
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- The method
hashCode
is necessary to be able
to use BehaviorIDs as keys in hashtables. The reason for this
is similar to the reason for having a special equals() method for
BehaviorIDs: passing BehaviorIDs around doesn't quite send the
same object around. The hash function used in a table will assign
two different values to these different objects, ALTHOUGH they are
they same BehaviorID.
The hash code returned is the numeric value for the BehaviorID. Note
that this is a good hash function, as the numeric value is unique
for a given BehaviorID. (The BehaviorCoordinator ensures this uniqueness.)
- Overrides:
hashCode
in class Object
- Returns:
- the hash value as an
int