Packages

class TypedMultiMap[T <: AnyRef, K[_ <: T]] extends AnyRef

An immutable multi-map that expresses the value type as a type function of the key type. Create it with a type constructor that expresses the relationship:

trait Key { type Type = T }
case class MyValue[T](...)

// type function from Key to MyValue
type KV[K <: Key] = MyValue[K#Type]

val map = TypedMultiMap.empty[Key, KV]

// a plain Int => String map would use this function:
type plain[K <: Int] = String

// a map T => T would use this function:
type identity[T <: AnyRef] = T

Caveat: using keys which take type parameters does not work due to conflicts with the existential interpretation of Key[_]. A workaround is to define a key type like above and provide a subtype that provides its type parameter as type member Type.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TypedMultiMap
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def ++(other: TypedMultiMap[T, K]): TypedMultiMap[T, K]

    Add all entries from the other map, overwriting existing entries.

    Add all entries from the other map, overwriting existing entries.

    FIXME: should it merge, instead?

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(other: Any): Boolean
    Definition Classes
    TypedMultiMap → AnyRef → Any
  9. def get(key: T): Set[K[key.type]]

    Obtain all mappings for the given key.

  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. def hashCode(): Int
    Definition Classes
    TypedMultiMap → AnyRef → Any
  12. def inserted(key: T)(value: K[key.type]): TypedMultiMap[T, K]

    Return a map that has the given value added to the mappings for the given key.

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def keyRemoved(key: T): TypedMultiMap[T, K]

    Return a map that has all mappings for the given key removed.

  15. def keySet: Set[T]

    Return the set of keys which are mapped to non-empty value sets.

  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  19. def removed(key: T)(value: K[key.type]): TypedMultiMap[T, K]

    Return a map that has the given mapping from the given key removed.

  20. def setAll(key: T)(values: Set[K[key.type]]): TypedMultiMap[T, K]
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    TypedMultiMap → AnyRef → Any
  23. def valueRemoved(value: Any): TypedMultiMap[T, K]

    Return a map that has the given value removed from all keys.

  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped