class ArrayMap[T >: Null <: AnyRef] extends AnyRef
Conceptually, a map where the (implicit) keys are positive Int
values and the values are
non-null
; null
values are not permitted!
The key values always have to be larger than or equal to 0 and are ideally continues
(0,1,2,3,...). The values are stored in a plain array to enable true O(1) retrieval.
Furthermore, the array is only as large as it has to be to keep the value associated
with the largest key.
- Self Type
- ArrayMap[T]
- Source
- ArrayMap.scala
- Note
This data structure is not thread safe.
- Alphabetic
- By Inheritance
- ArrayMap
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(key: Int): T
Returns the value stored for the given key or
null
instead.Returns the value stored for the given key or
null
instead.- Annotations
- @throws("if the key is negative")
- Note
If the key is not valid the result is not defined.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clear(): Unit
Clears, but does not resize/shrink the map.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def entries: Iterator[(Int, T)]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- ArrayMap → AnyRef → Any
- def forall(f: (T) => Boolean): Boolean
- def foreach(f: (Int, T) => Unit): Unit
- def foreachValue(f: (T) => Unit): Unit
- def get(key: Int): Option[T]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def getOrElse(key: Int, f: => T): T
- def getOrElseUpdate(key: Int, f: => T): T
- def hashCode(): Int
- Definition Classes
- ArrayMap → AnyRef → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[X](f: (Int, T) => X): List[X]
- def mkString(start: String, sep: String, end: String): String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def remove(key: Int): Unit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- ArrayMap → AnyRef → Any
- final def update(key: Int, value: T): Unit
Sets the value for the given key to the given value.
Sets the value for the given key to the given value. If the key cannot be stored in the currently used array, the underlying array is immediately resized to make it possible to store the new value.
- Annotations
- @throws("if the key is negative")
- def valuesIterator: Iterator[T]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated