object
Equality
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
asRef(x: Any): AnyRef
-
def
clone(): AnyRef
-
def
compareBlithely(x1: AnyRef, x2: AnyRef): Boolean
-
def
compareBlithely(x1: AnyRef, x2: Node): Boolean
-
def
compareBlithely(x1: AnyRef, x2: String): Boolean
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
In an attempt to contain the damage being inflicted on consistency by the ad hoc
equals
methods spread aroundxml
, the logic is centralized and all thexml
classes go through thexml.Equality trait
. There are two forms ofxml
comparison.def strict_==(other: scala.xml.Equality)
This one tries to honor the little things like symmetry and hashCode contracts. The
equals
method routes all comparisons through this.xml_==(other: Any)
This one picks up where
strict_==
leaves off. It might declare any two things equal.As things stood, the logic not only made a mockery of the collections equals contract, but also laid waste to that of case classes.
Among the obstacles to sanity are/were:
Node extends NodeSeq extends Seq[Node] MetaData extends Iterable[MetaData] The hacky "Group" xml node which throws exceptions with wild abandon, so don't get too close Rampant asymmetry and impossible hashCodes Most classes claiming to be equal to "String" if some specific stringification of it was the same. String was never going to return the favor.