SimpleIdentityMap

dotty.tools.dotc.util.SimpleIdentityMap
See theSimpleIdentityMap companion object
abstract class SimpleIdentityMap[K <: AnyRef, +V <: AnyRef] extends K => V | Null

A simple linked map with eq as the key comparison, optimized for small maps. It has linear complexity for apply, updated, and remove.

Attributes

Companion
object
Graph
Supertypes
trait K => V | Null
class Object
trait Matchable
class Any
Known subtypes
class Map1[K, V]
class Map2[K, V]
class Map3[K, V]
class Map4[K, V]
class MapMore[K, V]

Members list

Value members

Abstract methods

def apply(k: K): V | Null

Apply the body of this function to the argument.

Apply the body of this function to the argument.

Attributes

Returns

the result of function application.

def forallBinding(f: (K, V) => Boolean): Boolean
def foreachBinding(f: (K, V) => Unit): Unit
def mapValuesNow[V1 >: V <: AnyRef](f: (K, V1) => V1): SimpleIdentityMap[K, V1]
def remove(k: K): SimpleIdentityMap[K, V]
def size: Int
def updated[V1 >: V <: AnyRef](k: K, v: V1): SimpleIdentityMap[K, V1]

Concrete methods

def contains(k: K): Boolean
final def isEmpty: Boolean
def keys: List[K]
def map2[T](f: (K, V) => T): List[T]
def toList: List[(K, V)]
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any

Inherited methods

def andThen[A](g: V | Null => A): K => A

Composes two instances of Function1 in a new Function1, with this function applied first.

Composes two instances of Function1 in a new Function1, with this function applied first.

Type parameters

A

the result type of function g

Value parameters

g

a function R => A

Attributes

Returns

a new function f such that f(x) == g(apply(x))

Inherited from:
Function1
def compose[A](g: A => K): A => V | Null

Composes two instances of Function1 in a new Function1, with this function applied last.

Composes two instances of Function1 in a new Function1, with this function applied last.

Type parameters

A

the type to which function g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1