com.netflix.nfgraph
Interface OrdinalIterator

All Known Implementing Classes:
BitSetOrdinalIterator, CompactOrdinalIterator, HashSetOrdinalIterator, NFBuildGraphOrdinalIterator

public interface OrdinalIterator

OrdinalIterator is the interface used to iterate over a set of connections.

An OrdinalIterator may be obtained for a set of connections directly from an NFGraph or via an OrdinalSet obtained from an NFGraph.

See Also:
CompactOrdinalIterator, HashSetOrdinalIterator, BitSetOrdinalIterator

Field Summary
static OrdinalIterator EMPTY_ITERATOR
          An iterator which always return OrdinalIterator.NO_MORE_ORDINALS
static int NO_MORE_ORDINALS
          This value will be returned from nextOrdinal() after the iteration is completed.
 
Method Summary
 OrdinalIterator copy()
          Obtain a copy of this OrdinalIterator.
 boolean isOrdered()
           
 int nextOrdinal()
           
 void reset()
          Rewinds this OrdinalIterator to the beginning of the set.
 

Field Detail

NO_MORE_ORDINALS

static final int NO_MORE_ORDINALS
This value will be returned from nextOrdinal() after the iteration is completed.

See Also:
Constant Field Values

EMPTY_ITERATOR

static final OrdinalIterator EMPTY_ITERATOR
An iterator which always return OrdinalIterator.NO_MORE_ORDINALS

Method Detail

nextOrdinal

int nextOrdinal()
Returns:
the next ordinal in this set.

reset

void reset()
Rewinds this OrdinalIterator to the beginning of the set.


copy

OrdinalIterator copy()
Obtain a copy of this OrdinalIterator. The returned OrdinalIterator will be reset to the beginning of the set.


isOrdered

boolean isOrdered()
Returns:
true if the ordinals returned from this set are guaranteed to be in ascending order. Returns false otherwise.