com.netflix.nfgraph
Class OrdinalSet

java.lang.Object
  extended by com.netflix.nfgraph.OrdinalSet
Direct Known Subclasses:
BitSetOrdinalSet, CompactOrdinalSet, HashSetOrdinalSet, NFBuildGraphOrdinalSet

public abstract class OrdinalSet
extends java.lang.Object

OrdinalSet is the interface used to represent a set of connections.

An OrdinalSet is obtained directly from an NFGraph.

See Also:
NFGraph

Field Summary
static OrdinalSet EMPTY_SET
          An empty OrdinalSet.
 
Constructor Summary
OrdinalSet()
           
 
Method Summary
 int[] asArray()
          Returns an array containing all elements in the set.
abstract  boolean contains(int value)
          Returns true when the specified value is contained in this set.
 boolean containsAll(int... values)
          Returns true when all specified values are contained in this set.
abstract  OrdinalIterator iterator()
           
abstract  int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_SET

public static final OrdinalSet EMPTY_SET
An empty OrdinalSet.

Constructor Detail

OrdinalSet

public OrdinalSet()
Method Detail

contains

public abstract boolean contains(int value)
Returns true when the specified value is contained in this set. Depending on the implementation, this operation will have one of two performance characteristics:

O(1) for HashSetOrdinalSet and BitSetOrdinalSet
O(n) for CompactOrdinalSet and NFBuildGraphOrdinalSet


containsAll

public boolean containsAll(int... values)
Returns true when all specified values are contained in this set. Depending on the implementation, this operation will have one of two performance characteristics:

O(m) for HashSetOrdinalSet and BitSetOrdinalSet, where m is the number of specified elements.
O(n) for CompactOrdinalSet, where n is the number of elements in the set.
O(n * m) for NFBuildGraphOrdinalSet.


asArray

public int[] asArray()
Returns an array containing all elements in the set.


iterator

public abstract OrdinalIterator iterator()
Returns:
an OrdinalIterator over this set.

size

public abstract int size()
Returns:
the number of ordinals in this set.