trait _Trait[A, B] extends AnyRef

Two Directional Mapping

BiMap allows to convert value to some type and back

It is used in two way binded collections

val intToChar: BiMap[Int, Char] = BiMap(i => ('A' + i).toChar, _ - 'A')

val coll: Idx.M[Int]  = ~.*(0, 2, 4).to[Idx.M]
val view: Idx.M[Char] = x.asBiMappedView(intToChar)

coll.all.lp   // Prints: ~(0, 2, 4)
view.all.lp   // Prints: ~(A, C, E)

view(1) = 'Z' // Note, only second collection is updated, but both are changed

coll.all.lp   // Prints: ~(0, 25, 4)
view.all.lp   // Prints: ~(A, Z, E)
Ordering
  1. Alphabetic
Inherited
  1. BiMap
  2. scala.AnyRef
  3. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. abstract def apply(v: A): B

    Map

    Map

    Converts value

    Definition Classes
    _Trait
  2. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  3. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  4. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  5. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  7. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  8. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  9. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. final def notify(): Unit
    Definition Classes
    AnyRef
  11. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  12. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  13. def toString(): String
    Definition Classes
    AnyRef → Any
  14. abstract def undo(v: B): A

    Undo map

    Undo map

    Restores conversion result to original value

    Definition Classes
    _Trait
  15. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any