final case class IdentityPair[+T1 <: AnyRef, +T2 <: AnyRef](_1: T1, _2: T2) extends Product2[T1, T2] with Product with Serializable
Encapsulates a pair of values that is intended to be used as a key in Maps.
Compared to a standard pair (Tuple2), however, comparison of two IdentityPair
objects is done by doing a reference-based comparison of the stored values.
- _1
A reference value (can be
null
).- _2
A reference value (can be
null
).
- Source
- IdentityPair.scala
val a = new String("fooBar") val b = "foo"+"Bar" val p1 = new IdentityPair(a,b) // #1 val p2 = new IdentityPair(a,a) // #2 val p3 = new IdentityPair(a,b) // #3 p1 == p2 // => false (though (a,b) == (a,a) would be true p1 == p3 // => true
- Alphabetic
- By Inheritance
- IdentityPair
- Serializable
- Product2
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new IdentityPair(_1: T1, _2: T2)
- _1
A reference value (can be
null
).- _2
A reference value (can be
null
).
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val _1: T1
- Definition Classes
- IdentityPair → Product2
- val _2: T2
- Definition Classes
- IdentityPair → Product2
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def canEqual(other: Any): Boolean
- Definition Classes
- IdentityPair → Equals
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- IdentityPair → Equals → AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- IdentityPair → AnyRef → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def productArity: Int
- Definition Classes
- Product2 → Product
- def productElement(n: Int): Any
- Definition Classes
- Product2 → Product
- Annotations
- @throws(classOf[java.lang.IndexOutOfBoundsException])
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated