planet.generic.commonapi.factory
Class IdFactoryImpl.DistributedIdIterator

java.lang.Object
  extended byplanet.generic.commonapi.factory.IdFactoryImpl.DistributedIdIterator
All Implemented Interfaces:
java.util.Iterator, java.io.Serializable
Enclosing class:
IdFactoryImpl

public class IdFactoryImpl.DistributedIdIterator
extends java.lang.Object
implements java.util.Iterator, java.io.Serializable

Is an Id iterator, for building up to networkSize Id. All Id are equidistant between two consecutive Id.

Author:
Jordi Pujol 28/02/2005
See Also:
Serialized Form

Constructor Summary
IdFactoryImpl.DistributedIdIterator(int networkSize, Id initialValue, Id chunkValue)
          Initialize this instance with the specified values.
 
Method Summary
 boolean hasNext()
          Test if all Id have been built.
 java.lang.Object next()
          The next Id or null if all networkSize Id has been generated.
 void remove()
          This method is not implemented and throws a NoSuchMethodError error always.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdFactoryImpl.DistributedIdIterator

public IdFactoryImpl.DistributedIdIterator(int networkSize,
                                           Id initialValue,
                                           Id chunkValue)
Initialize this instance with the specified values. The first returned Id for the next() method will be:

initialValue+chunkValue

Parameters:
networkSize - Number of Id to build.
initialValue - Initial Id value.
chunkValue - Increment value between two consecutive Ids.
Method Detail

hasNext

public boolean hasNext()
Test if all Id have been built.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the number of built Ids is less than the initial networkSize.
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
The next Id or null if all networkSize Id has been generated.

Specified by:
next in interface java.util.Iterator
Returns:
The next Id or null if all ones has been generated.
See Also:
Iterator.next()

remove

public void remove()
This method is not implemented and throws a NoSuchMethodError error always.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.NoSuchMethodError - always.
See Also:
Iterator.remove()


TD>