|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.nfgraph.OrdinalSet
com.netflix.nfgraph.compressed.HashSetOrdinalSet
public class HashSetOrdinalSet
An implementation of OrdinalSet, returned for connections represented as variable-byte hashed integer arrays in an NFCompressedGraph.
CompactOrdinalSet.
The byte array can be thought of as a open-addressed hash table, with each byte representing a single bucket. Because
values may be represented in more than one byte, single values may spill over into multiple buckets. The beginning of the
value is indicated by an unset sign bit, and will be located at or after the bucket to which it is hashed. If the value's
first bit is not located at the hashed position, it will be located in a position after the bucket with no empty buckets in between.
This implementation provides O(1) time for contains(), but is not as memory-efficient as a CompactOrdinalSet.
This representation for a connection set can be configured for an NFPropertySpec using NFPropertySpec.HASH.
| Field Summary |
|---|
| Fields inherited from class com.netflix.nfgraph.OrdinalSet |
|---|
EMPTY_SET |
| Constructor Summary | |
|---|---|
HashSetOrdinalSet(com.netflix.nfgraph.util.ByteArrayReader reader)
|
|
| Method Summary | |
|---|---|
boolean |
contains(int value)
Returns true when the specified value is contained in this set. |
OrdinalIterator |
iterator()
|
int |
size()
|
| Methods inherited from class com.netflix.nfgraph.OrdinalSet |
|---|
asArray, containsAll |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HashSetOrdinalSet(com.netflix.nfgraph.util.ByteArrayReader reader)
| Method Detail |
|---|
public OrdinalIterator iterator()
iterator in class OrdinalSetOrdinalIterator over this set.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 BitSetOrdinalSetO(n) for CompactOrdinalSet and NFBuildGraphOrdinalSet
contains in class OrdinalSetpublic int size()
size in class OrdinalSet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||