Trait

scala.collection.mutable

HashTable

Related Doc: package mutable

Permalink

trait HashTable[A, Entry >: Null <: HashEntry[A, Entry]] extends HashUtils[A]

This class can be used to construct data structures that are based on hashtables. Class HashTable[A] implements a hashtable that maps keys of type A to values of the fully abstract member type Entry. Classes that make use of HashTable have to provide an implementation for Entry.

There are mainly two parameters that affect the performance of a hashtable: the initial size and the load factor. The size refers to the number of buckets in the hashtable, and the load factor is a measure of how full the hashtable is allowed to get before its size is automatically doubled. Both parameters may be changed by overriding the corresponding values in class HashTable.

A

type of the elements contained in this hash table.

Version

2.0, 31/12/2006

Since

1

Linear Supertypes
HashUtils[A], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HashTable
  2. HashUtils
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def createNewEntry[B](key: A, value: B): Entry

    Permalink

    Creates new entry to be immediately inserted into the hashtable.

    Creates new entry to be immediately inserted into the hashtable. This method is guaranteed to be called only once and in case that the entry will be added. In other words, an implementation may be side-effecting.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. var _loadFactor: Int

    Permalink
    Attributes
    protected
  5. def addEntry(e: Entry): Unit

    Permalink

    Add entry to table pre: no entry with same key exists

    Add entry to table pre: no entry with same key exists

    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  6. def alwaysInitSizeMap: Boolean

    Permalink
    Attributes
    protected
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def calcSizeMapSize(tableLength: Int): Int

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  9. def clearTable(): Unit

    Permalink

    Remove all entries from table

    Remove all entries from table

    Attributes
    protected
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def elemEquals(key1: A, key2: A): Boolean

    Permalink
    Attributes
    protected
  12. def elemHashCode(key: A): Int

    Permalink
    Attributes
    protected
    Definition Classes
    HashUtils
  13. def entriesIterator: Iterator[Entry]

    Permalink

    An iterator returning all entries.

    An iterator returning all entries.

    Attributes
    protected
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def findEntry(key: A): Entry

    Permalink

    Find entry with given key in table, null if not found.

    Find entry with given key in table, null if not found.

    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  18. def findOrAddEntry[B](key: A, value: B): Entry

    Permalink

    Find entry with given key in table, or add new one if not found.

    Find entry with given key in table, or add new one if not found. May be somewhat faster then findEntry/addEntry pair as it computes entry's hash index only once. Returns entry found in table or null. New entries are created by calling createNewEntry method.

    Attributes
    protected
  19. def foreachEntry[U](f: (Entry) ⇒ U): Unit

    Permalink

    Avoid iterator for a 2x faster traversal.

    Avoid iterator for a 2x faster traversal.

    Attributes
    protected
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def improve(hcode: Int, seed: Int): Int

    Permalink

    Defer to a high-quality hash in scala.util.hashing.

    Defer to a high-quality hash in scala.util.hashing. The goal is to distribute across bins as well as possible even if a hash code has low entropy at some bits.

    OLD VERSION - quick, but bad for sequence 0-10000 - little entropy in higher bits - since 2003

    var h: Int = hcode + ~(hcode << 9)
    h = h ^ (h >>> 14)
    h = h + (h << 4)
    h ^ (h >>> 10)

    the rest of the computation is due to SI-5293

    Attributes
    protected
    Definition Classes
    HashUtils
  23. final def index(hcode: Int): Int

    Permalink

    Note: we take the most significant bits of the hashcode, not the lower ones this is of crucial importance when populating the table in parallel

    Note: we take the most significant bits of the hashcode, not the lower ones this is of crucial importance when populating the table in parallel

    Attributes
    protected
  24. def initWithContents(c: Contents[A, Entry]): Unit

    Permalink
    Attributes
    protected
  25. def initialSize: Int

    Permalink

    The initial size of the hash table.

    The initial size of the hash table.

    Attributes
    protected
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. def isSizeMapDefined: Boolean

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. def nnSizeMapAdd(h: Int): Unit

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  30. def nnSizeMapRemove(h: Int): Unit

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  31. def nnSizeMapReset(tableLength: Int): Unit

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. def removeEntry(key: A): Entry

    Permalink

    Remove entry from table if present.

    Remove entry from table if present.

    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  35. var seedvalue: Int

    Permalink
    Attributes
    protected
  36. final def sizeMapBucketBitSize: Int

    Permalink
    Attributes
    protected
    Definition Classes
    HashUtils
  37. final def sizeMapBucketSize: Int

    Permalink
    Attributes
    protected
    Definition Classes
    HashUtils
  38. def sizeMapDisable(): Unit

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  39. def sizeMapInit(tableLength: Int): Unit

    Permalink
    Attributes
    protected
  40. def sizeMapInitAndRebuild(): Unit

    Permalink
    Attributes
    protected
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  41. var sizemap: Array[Int]

    Permalink

    The array keeping track of the number of elements in 32 element blocks.

    The array keeping track of the number of elements in 32 element blocks.

    Attributes
    protected
  42. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  43. var table: Array[HashEntry[A, Entry]]

    Permalink

    The actual hash table.

    The actual hash table.

    Attributes
    protected
  44. var tableSize: Int

    Permalink

    The number of mappings contained in this hash table.

    The number of mappings contained in this hash table.

    Attributes
    protected
  45. def tableSizeSeed: Int

    Permalink
    Attributes
    protected
  46. var threshold: Int

    Permalink

    The next size value at which to resize (capacity * load factor).

    The next size value at which to resize (capacity * load factor).

    Attributes
    protected
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from HashUtils[A]

Inherited from AnyRef

Inherited from Any

Ungrouped