Class/Object

metal.mutable

HashMap

Related Docs: object HashMap | package mutable

Permalink

final class HashMap[K, V] extends generic.HashMap[K, V] with Map[K, V]

Source
HashMap.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HashMap
  2. Map
  3. Updatable
  4. AddKeys
  5. Removable
  6. Collection
  7. HashMap
  8. Map
  9. NElements2
  10. Elements2
  11. Elements1
  12. Values
  13. Searchable
  14. Keys
  15. Defaults
  16. Collection
  17. Enumerable
  18. Nextable
  19. Pointable
  20. AnyRef
  21. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HashMap(keys: Array[K], buckets: Array[Byte], values: Array[V], size: Int, used: Int, mask: Int, limit: Int)(implicit K: Methods[K], V: Methods[V])

    Permalink

Type Members

  1. type Generic = generic.Map[K, V]

    Permalink

    Generic type of this collection (e.g.

    Generic type of this collection (e.g. Map, Map2, Set).

    Definition Classes
    MapDefaultsCollection
  2. type Immutable = immutable.HashMap[K, V]

    Permalink

    Immutable variant of this collection.

    Immutable variant of this collection.

    Definition Classes
    HashMapMapDefaultsCollection
  3. type Mutable = HashMap[K, V]

    Permalink

    Mutable variant of this collection.

    Mutable variant of this collection.

    Definition Classes
    HashMapMapDefaultsCollection

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. implicit val K: Methods[K]

    Permalink
    Definition Classes
    HashMapMap
  5. implicit val V: Methods[V]

    Permalink
    Definition Classes
    HashMapMap
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def bucket(i: Int): Byte

    Permalink
    Definition Classes
    HashMap
  8. var buckets: Array[Byte]

    Permalink

    Status of the slots in the hash table.

    Status of the slots in the hash table.

    Definition Classes
    HashMapHashMap
  9. def clear(): Unit

    Permalink

    Removes all elements from this collection, deallocating its arrays.

    Removes all elements from this collection, deallocating its arrays.

    Definition Classes
    HashMapRemovableCollection
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(any: Any): Boolean

    Permalink

    Checks if two collections are equal.

    Checks if two collections are equal.

    Equal means the collections have the same generic type (which is checked by the method ptrCastT) and the same contents.

    Comparing metal collections with any other collection types (including those from Scala) will return false.

    Definition Classes
    Defaults → AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def grow(): Unit

    Permalink

    Grow the underlying array to best accomodate the map's size.

    Grow the underlying array to best accomodate the map's size.

    To preserve hashing access speed, the map's size should never be more than 66% of the underlying array's size. When this size is reached, the map needs to be updated (using this method) to have a larger array.

    The underlying array's size must always be a multiple of 2, which means this method grows the array's size by 2x (or 4x if the map is very small). This doubling helps amortize the cost of resizing, since as the map gets larger growth will happen less frequently. This method returns a null of type Unit1[A] to trigger specialization without allocating an actual instance.

    Growing is an O(n) operation, where n is the map's size.

  16. def hashCode(): Int

    Permalink

    Hashes the contents of the collection to an Int value.

    Hashes the contents of the collection to an Int value.

    By xor'ing all the collection's element hashes together, we can be sure that collections with the same contents will have the same hashCode regardless of the order those items appear.

    Definition Classes
    Defaults → AnyRef → Any
  17. final def isEmpty: Boolean

    Permalink

    Returns true if the container is empty, false otherwise.

    Returns true if the container is empty, false otherwise.

    Definition Classes
    HashMapEnumerable
    Annotations
    @inline()
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def key(i: Int): K

    Permalink
    Definition Classes
    HashMap
  20. def keyArray(ptr: VPtr[HashMap.this.type]): Array[K]

    Permalink
    Definition Classes
    HashMapMap
  21. def keyIndex(ptr: VPtr[HashMap.this.type]): Int

    Permalink
    Definition Classes
    HashMapMap
  22. var keys: Array[K]

    Permalink

    Slots for keys.

    Slots for keys.

    Definition Classes
    HashMapHashMap
  23. var limit: Int

    Permalink

    Point at which we should grow.

    Point at which we should grow.

    Definition Classes
    HashMapHashMap
  24. final def longSize: Long

    Permalink

    Return the size of this container; we use Long so that big containers can be manipulated.

    Return the size of this container; we use Long so that big containers can be manipulated.

    Definition Classes
    HashMapEnumerable
    Annotations
    @inline()
  25. var mask: Int

    Permalink

    Mask = nSlots - 1, used for hashing.

    Mask = nSlots - 1, used for hashing.

    Definition Classes
    HashMapHashMap
  26. def mutableCopy: HashMap[K, V]

    Permalink

    Creates a mutable copy of this collection.

    Creates a mutable copy of this collection.

    Definition Classes
    HashMapCollection
  27. def nSlots: Int

    Permalink
    Definition Classes
    HashMap
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def nonEmpty: Boolean

    Permalink

    Returns true if the container is non-empty, false otherwise.

    Returns true if the container is non-empty, false otherwise.

    Definition Classes
    HashMapEnumerable
    Annotations
    @inline()
  30. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  32. def priorityEquals: Boolean

    Permalink

    Flag indicating that the equals methods of this object should be called in priority.

    Flag indicating that the equals methods of this object should be called in priority.

    Definition Classes
    Defaults
  33. final def ptr: Ptr[HashMap.this.type]

    Permalink

    Returns a pointer to the start of this container instance.

    Returns a pointer to the start of this container instance.

    Definition Classes
    HashMapEnumerable
  34. final def ptrAddKey[L](key: L): VPtr[HashMap.this.type]

    Permalink

    Adds the given key to the container.

    Adds the given key to the container. If the key is already present, returns the pointer associated with the existing key. If the key is new, any eventual associated values are undefined (they should immediately be updated).

    Definition Classes
    HashMapAddKeys
  35. def ptrAddKeyFromArray(array: Array[_], i: Int): VPtr[HashMap.this.type]

    Permalink

    Adds the given key to the container, similarly to ptrAddKey, but takes the key from the given array, which should be of type Array[K].

    Adds the given key to the container, similarly to ptrAddKey, but takes the key from the given array, which should be of type Array[K]. The array type is however recovered at runtime to avoid boxing.

    Definition Classes
    AddKeys
  36. final def ptrCastT(any: Any): Opt[generic.Map[K, V]]

    Permalink

    Tests if the parameter has the same generic type, and returns an optional cast.

    Tests if the parameter has the same generic type, and returns an optional cast.

    Definition Classes
    MapDefaults
  37. final def ptrElement1[E1](ptr: VPtr[HashMap.this.type]): E1

    Permalink
    Definition Classes
    HashMapElements1
  38. final def ptrElement2[E2](ptr: VPtr[HashMap.this.type]): E2

    Permalink
    Definition Classes
    HashMapElements2
  39. final def ptrEquals(thisPtr: VPtr[HashMap.this.type], that: generic.Map[K, V]): Boolean

    Permalink

    Checks that the pointed element exists in the other collection and has the same value.

    Checks that the pointed element exists in the other collection and has the same value.

    Definition Classes
    MapDefaults
  40. final def ptrFind[L](key: L): Ptr[HashMap.this.type]

    Permalink

    Returns a pointer to the given item, if it exists, or null.

    Returns a pointer to the given item, if it exists, or null.

    Definition Classes
    HashMapSearchable
  41. def ptrFindFromArray(array: Array[_], i: Int): Ptr[HashMap.this.type]

    Permalink
    Definition Classes
    Searchable
  42. def ptrHash(ptr: VPtr[HashMap.this.type]): Int

    Permalink

    Returns the hashCode of the pointed element.

    Returns the hashCode of the pointed element.

    Definition Classes
    MapDefaults
  43. final def ptrKey[L](ptr: VPtr[HashMap.this.type]): L

    Permalink

    Returns the key pointed by ptr.

    Returns the key pointed by ptr.

    Definition Classes
    HashMapKeys
  44. final def ptrNext(ptr: VPtr[HashMap.this.type]): Ptr[HashMap.this.type]

    Permalink

    Returns a pointer to the next element if available, or returns a null pointer.

    Returns a pointer to the next element if available, or returns a null pointer.

    Definition Classes
    HashMapNextable
  45. final def ptrRemove(vp: VPtr[HashMap.this.type]): Unit

    Permalink

    Removes the pointed element.

    Removes the pointed element.

    Definition Classes
    HashMapRemovable
  46. final def ptrRemoveAndAdvance(vp: VPtr[HashMap.this.type]): Ptr[HashMap.this.type]

    Permalink

    Removes the pointed element, and returns the pointer to the next element, or null if at the end.

    Removes the pointed element, and returns the pointer to the next element, or null if at the end.

    Definition Classes
    HashMapRemovable
  47. def ptrToString(ptr: VPtr[HashMap.this.type]): String

    Permalink

    Returns the toString representation of the pointed element.

    Returns the toString representation of the pointed element.

    Definition Classes
    MapDefaults
  48. final def ptrUpdate[W](vp: VPtr[HashMap.this.type], v: W): Unit

    Permalink
    Definition Classes
    HashMapUpdatable
  49. def ptrUpdateFromArray(ptr: VPtr[HashMap.this.type], array: Array[_], i: Int): Unit

    Permalink
    Definition Classes
    Updatable
  50. final def ptrValue[W](ptr: VPtr[HashMap.this.type]): W

    Permalink

    Returns the value of the object pointed by the pointer.

    Returns the value of the object pointed by the pointer.

    Definition Classes
    HashMapValues
  51. def reset(): Unit

    Permalink

    Removes all elements from this collection, keeping the all allocated arrays.

    Removes all elements from this collection, keeping the all allocated arrays.

    Definition Classes
    HashMapCollection
  52. def result(): immutable.HashMap[K, V]

    Permalink

    Returns an immutable version of this mutable collection.

    Returns an immutable version of this mutable collection. The mutable instance is cleared.

    Definition Classes
    HashMapCollection
  53. var size: Int

    Permalink

    Number of defined slots.

    Number of defined slots.

    Definition Classes
    HashMapHashMap
  54. def stringPrefix: String

    Permalink

    String prefix used in the toString method.

    String prefix used in the toString method.

    Definition Classes
    MapCollection
  55. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  56. def toImmutable: immutable.HashMap[K, V]

    Permalink

    Returns this collection if already immutable, or an immutable copy.

    Returns this collection if already immutable, or an immutable copy.

    Definition Classes
    HashMapCollection
  57. def toString(): String

    Permalink
    Definition Classes
    Defaults → AnyRef → Any
  58. var used: Int

    Permalink

    Number of used slots.

    Number of used slots.

    Definition Classes
    HashMapHashMap
  59. def value(i: Int): V

    Permalink
    Definition Classes
    HashMap
  60. def valueArray(ptr: VPtr[HashMap.this.type]): Array[V]

    Permalink
    Definition Classes
    HashMapMap
  61. def valueIndex(ptr: VPtr[HashMap.this.type]): Int

    Permalink
    Definition Classes
    HashMapMap
  62. var values: Array[V]

    Permalink

    Slots for values.

    Slots for values.

    Definition Classes
    HashMapHashMap
  63. final def wait(): Unit

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

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

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

Inherited from Map[K, V]

Inherited from Updatable[V]

Inherited from AddKeys[K]

Inherited from Removable

Inherited from Collection

Inherited from generic.HashMap[K, V]

Inherited from generic.Map[K, V]

Inherited from NElements2[K, V]

Inherited from Elements2[V]

Inherited from Elements1[K]

Inherited from Values[V]

Inherited from Searchable[K]

Inherited from Keys[K]

Inherited from Defaults

Inherited from generic.Collection

Inherited from Enumerable

Inherited from Nextable

Inherited from Pointable

Inherited from AnyRef

Inherited from Any

Ungrouped