anthill.nestor
Class LocalRequestSet

java.lang.Object
  |
  +--anthill.nestor.LocalRequestSet
All Implemented Interfaces:
Clearable, RequestSet

public class LocalRequestSet
extends java.lang.Object
implements RequestSet

This class is a simple implementation of ResourceSet containing an hash table mapping ant identifiers to response listeners.


Constructor Summary
LocalRequestSet()
          Constructor
 
Method Summary
 void add(AntId aid, ResponseListener listener)
          Adds an association between ant identifier and the listener interested in the responses returned by this ant.
 void clear()
          Restores the object to its initial state.
 void returnResources(AntId aid, Resource[] resources)
          Returns the specified resources to the listener associated to the given ant identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalRequestSet

public LocalRequestSet()
Constructor
Method Detail

add

public void add(AntId aid,
                ResponseListener listener)
Description copied from interface: RequestSet
Adds an association between ant identifier and the listener interested in the responses returned by this ant.
Specified by:
add in interface RequestSet
Following copied from interface: anthill.nest.RequestSet
Parameters:
aid - the ant identifier
listener - the listener which will be notified when a response is available

returnResources

public void returnResources(AntId aid,
                            Resource[] resources)
Description copied from interface: RequestSet
Returns the specified resources to the listener associated to the given ant identifier.
Specified by:
returnResources in interface RequestSet
Following copied from interface: anthill.nest.RequestSet
Parameters:
aid - the ant identifier
resources - the resources found.

clear

public void clear()
Restores the object to its initial state.
Specified by:
clear in interface Clearable