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 ->[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()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. 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
  9. 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
  10. 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
  11. 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
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(other: Any): Boolean
    Definition Classes
    TypedMultiMap → AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. 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()
  16. def get(key: T): Set[K[key.type]]

    Obtain all mappings for the given key.

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

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

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

  22. def keySet: Set[T]

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

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

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

  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    TypedMultiMap → AnyRef → Any
  29. def valueRemoved(value: Any): TypedMultiMap[T, K]

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

  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. 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