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.

Source
TypedMultiMap.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TypedMultiMap
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to any2stringadd[TypedMultiMap[T, K]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. 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?

  5. def ->[B](y: B): (TypedMultiMap[T, K], B)
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to ArrowAssoc[TypedMultiMap[T, K]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def ensuring(cond: (TypedMultiMap[T, K]) ⇒ Boolean, msg: ⇒ Any): TypedMultiMap[T, K]
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to Ensuring[TypedMultiMap[T, K]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (TypedMultiMap[T, K]) ⇒ Boolean): TypedMultiMap[T, K]
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to Ensuring[TypedMultiMap[T, K]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): TypedMultiMap[T, K]
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to Ensuring[TypedMultiMap[T, K]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): TypedMultiMap[T, K]
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to Ensuring[TypedMultiMap[T, K]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(other: Any): Boolean
    Definition Classes
    TypedMultiMap → AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to StringFormat[TypedMultiMap[T, K]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  17. def get(key: T): Set[K[key.type]]

    Obtain all mappings for the given key.

  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def hashCode(): Int
    Definition Classes
    TypedMultiMap → AnyRef → Any
  20. 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.

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

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

  23. def keySet: Set[T]

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

  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. def removed(key: T)(value: K[key.type]): TypedMultiMap[T, K]

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

  28. def setAll(key: T)(values: Set[K[key.type]]): TypedMultiMap[T, K]
  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    TypedMultiMap → AnyRef → Any
  31. def valueRemoved(value: Any): TypedMultiMap[T, K]

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

  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  35. def [B](y: B): (TypedMultiMap[T, K], B)
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] to ArrowAssoc[TypedMultiMap[T, K]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from TypedMultiMap[T, K] to any2stringadd[TypedMultiMap[T, K]]

Inherited by implicit conversion StringFormat from TypedMultiMap[T, K] to StringFormat[TypedMultiMap[T, K]]

Inherited by implicit conversion Ensuring from TypedMultiMap[T, K] to Ensuring[TypedMultiMap[T, K]]

Inherited by implicit conversion ArrowAssoc from TypedMultiMap[T, K] to ArrowAssoc[TypedMultiMap[T, K]]

Ungrouped