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.

Version:
$Revision$
Author:
Alberto Montresor

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

Constructor Detail

LocalRequestSet

public LocalRequestSet()
Constructor
Method Detail

add

public void add(RequestId key,
                ResponseListener listener)
Description copied from interface: RequestSet
Adds an association between a key 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:
key - the key that will be used later to obtain the listener
listener - the listener which will be notified when a response is available

returnResources

public boolean returnResources(RequestId key,
                               Resource[] resources)
Description copied from interface: RequestSet
Returns the specified resources to the listener associated to the given key
Specified by:
returnResources in interface RequestSet
Following copied from interface: anthill.nest.RequestSet
Parameters:
key - the key that is used to obtain listener
resources - the resources found.

clear

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object