public class BitSetOrdinalSet extends OrdinalSet
OrdinalSet, returned for connections represented as a bit set in an NFCompressedGraph.A bit set representation contains a single bit per ordinal in the type to which the connections point. If the bit at the position for a given ordinal is set, then there is a connection to that ordinal in this set.
Because determining membership in a set requires only checking whether the bit at a given position is set, contains()
is an O(1) operation.
This representation will automatically be chosen for a set by the NFCompressedGraphBuilder when it requires fewer bytes than
the configured representation (either NFPropertySpec.COMPACT or NFPropertySpec.HASH).
EMPTY_SET| Constructor and Description |
|---|
BitSetOrdinalSet(com.netflix.nfgraph.util.ByteArrayReader reader) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(int value)
Returns
true when the specified value is contained in this set. |
OrdinalIterator |
iterator() |
int |
size() |
asArray, containsAllpublic BitSetOrdinalSet(com.netflix.nfgraph.util.ByteArrayReader reader)
public boolean contains(int value)
OrdinalSettrue 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
contains in class OrdinalSetpublic OrdinalIterator iterator()
iterator in class OrdinalSetOrdinalIterator over this set.public int size()
size in class OrdinalSet