LongHashSet

com.netflix.atlas.core.util.LongHashSet
class LongHashSet(noData: Long, capacity: Int)

Mutable integer set based on open-addressing. Primary use-case is deduping integers so it only supports add and foreach.

Value parameters

capacity

Initial capacity guideline. The actual size of the underlying buffer will be the next prime >= capacity. Default is 10.

noData

Value to use to represent no data in the array. This value should not be used in the input.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def add(v: Long): Unit

Add an integer into the set. The value, v, should not be equivalent to the noData value used for this set.

Add an integer into the set. The value, v, should not be equivalent to the noData value used for this set.

Attributes

def foreach(f: Long => Unit): Unit

Execute f for each item in the set.

Execute f for each item in the set.

Attributes

def size: Int

Return the number of items in the set. This is a constant time operation.

Return the number of items in the set. This is a constant time operation.

Attributes

def toArray: Array[Long]

Converts this set to an Array[Int].

Converts this set to an Array[Int].

Attributes

def toList: List[Long]

Converts this set to a List[Int]. Used mostly for debugging and tests.

Converts this set to a List[Int]. Used mostly for debugging and tests.

Attributes