net.grinder.util
Interface AllocateLowestNumber

All Known Implementing Classes:
AllocateLowestNumberImplementation

public interface AllocateLowestNumber

A set that associates an number with each of member. Objects added to the set are allocated the lowest available number, starting at 0.

Author:
Philip Aston

Nested Class Summary
static interface AllocateLowestNumber.IteratorCallback
          Iteration callback, see forEach(net.grinder.util.AllocateLowestNumber.IteratorCallback).
 
Method Summary
 int add(Object o)
          Add a new object.
 void forEach(AllocateLowestNumber.IteratorCallback iteratorCallback)
          Call iteratorCallback for each member of the set.
 void remove(Object o)
          Remove an object from the set.
 

Method Detail

add

int add(Object o)
Add a new object. If the object already belongs to the set, the existing associated number is returned.

Parameters:
o - The object.
Returns:
The associated number.

remove

void remove(Object o)
Remove an object from the set. The number previously associated with the object (if any) is freed for re-use.

Parameters:
o - The object.

forEach

void forEach(AllocateLowestNumber.IteratorCallback iteratorCallback)
Call iteratorCallback for each member of the set.

Parameters:
iteratorCallback - Called for each member of the set.


Copyright © 2000-2013. All Rights Reserved.