|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antsim.nestor.LocalGate
Class LocalGate
is the implementation of Gate
to be used during off-line simulations. Communication among different
LocalGate
s is based on local method invocations.
Field Summary |
Fields inherited from interface anthill.nest.Gate |
NAME |
Constructor Summary | |
LocalGate(Factory factory,
String name)
Initializes a new LocalGate by creating
a new local nest identifier. |
Method Summary | |
void |
clear()
Restores the object to its initial state. |
NestId |
getNestId()
Returns the identifier of the Nest to which this
gate is associated. |
void |
send(NestId dest,
Ant ant,
int ttl)
Sends an ant to the specified nest. |
void |
setAntListener(AntListener listener)
Sets the ant listener, i.e. the object that will accept the ants coming from other nests. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalGate(Factory factory, String name)
LocalGate
by creating
a new local nest identifier.
factory
- the factory to be used to read configuration arguments
and to create other configurable objectsname
- the name that is associated to this instance in the
configuration fileMethod Detail |
public NestId getNestId()
Nest
to which this
gate is associated.
getNestId
in interface Gate
public void setAntListener(AntListener listener)
setAntListener
in interface Gate
listener
- the listener object that will
accepts the ants coming from other nestspublic void send(NestId dest, Ant ant, int ttl) throws ClassCastException, IOException
send
in interface Gate
ClassCastException
- raised if the nest identifier does not belong to the
expected class
IOException
- raised if problems have occurred during serialization
and sendingpublic void clear()
clear
in interface Clearable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |