class HashSet [ T ]
extends Set

A hash set that allows some privileged protected access to its internals

Constructors

HashSet ( initialCapacity: Int , loadFactor: Float )

Members

private val initialCapacity : Int
private var limit : Int
private val loadFactor : Float
private var rover : Int
private var table : Array [ AnyRef ]
private var used : Int
def addEntries ( xs: TraversableOnce [ T ] ) : Unit

Add all entries in xs to set

Add all entries in xs to set

def addEntry ( x: T ) : Unit

Add entry x to set

Add entry x to set

[+] protected def addEntryAfterScan ( x: T ) : T

Privileged access: Add entry x at the last position where an unsuccsessful findEntryByHash or nextEntryByhash operation returned. Needs to immediately f...

Privileged access: Add entry x at the last position where an unsuccsessful findEntryByHash or nextEntryByhash operation returned. Needs to immediately follow a findEntryByhash or nextEntryByHash operation that was unsucessful, i.e. that returned null.

private def addEntryAt ( idx: Int , x: T ) : T

Add entry at x at index idx

Add entry at x at index idx

private def addOldEntry ( x: T ) : Unit
private def allocate ( size: Int ) : Unit
def clear ( ) : Unit

Remove all elements from this set and set back to initial configuration

Remove all elements from this set and set back to initial configuration

def findEntry ( x: T ) : T

The entry in the set such that x equals entry, or else null.

The entry in the set such that x equals entry, or else null.

protected def findEntryByHash ( hashCode: Int ) : T

Privileged access: Find first entry with given hashcode

Privileged access: Find first entry with given hashcode

def findEntryOrUpdate ( x: T ) : T

Find entry such that x equals entry. If it exists, return it. If not, enter x in set and return x.

Find entry such that x equals entry. If it exists, return it. If not, enter x in set and return x.

private def growTable ( ) : Unit
def hash ( x: T ) : Int

Hashcode, can be overridden

Hashcode, can be overridden

private def index ( x: Int ) : Int

Turn hashode x into a table index

Turn hashode x into a table index

def iterator : Iterator [ T ]

The iterator of all elements in the set

The iterator of all elements in the set

private def limit_= ( x$1: Int ) : Unit
protected def nextEntryByHash ( hashCode: Int ) : T

Privileged access: Find next entry with given hashcode. Needs to immediately follow a findEntryByhash or nextEntryByHash operation.

Privileged access: Find next entry with given hashcode. Needs to immediately follow a findEntryByhash or nextEntryByHash operation.

private def rover_= ( x$1: Int ) : Unit
def size : Int

The number of elements in the set

The number of elements in the set

private def table_= ( x$1: Array [ AnyRef ] ) : Unit
override def toString ( ) : String
private def used_= ( x$1: Int ) : Unit