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.

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. Protected

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] toany2stringadd[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] toArrowAssoc[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[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  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] toEnsuring[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] toEnsuring[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] toEnsuring[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] toEnsuring[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 get(key: T): Set[K[key.type]]

    Obtain all mappings for the given key.

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

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

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

  21. def keySet: Set[T]

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

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

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

  26. def setAll(key: T)(values: Set[K[key.type]]): TypedMultiMap[T, K]
  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(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  32. 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)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] toStringFormat[TypedMultiMap[T, K]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (TypedMultiMap[T, K], B)
    Implicit
    This member is added by an implicit conversion from TypedMultiMap[T, K] toArrowAssoc[TypedMultiMap[T, K]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped