anthill.nest
Interface RequestSet

All Superinterfaces:
Clearable
All Known Implementing Classes:
LocalRequestSet

public interface RequestSet
extends Clearable

The RequestSet interface represents a data structure containing associations between ant identifiers and listeners interested in the responses returned by those ants.

RequestSet is one of the components of a nest; the other are Manager), Trail, Storage and Gate.


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 returnResources(AntId aid, Resource[] resources)
          Returns the specified resources to the listener associated to the given ant identifier.
 
Methods inherited from interface anthill.util.Clearable
clear
 

Method Detail

add

public void add(AntId aid,
                ResponseListener listener)
Adds an association between ant identifier and the listener interested in the responses returned by this ant.
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)
Returns the specified resources to the listener associated to the given ant identifier.
Parameters:
aid - the ant identifier
resources - the resources found.