Indicates whether the passed object is an instance of type A
.
Indicates whether the passed object is an instance of type A
.
This method is invoked by sibling method areEqual
to determine whether or not
b
can be cast to A so that it can be safely passed to normalized
.
To implement this method, simply call b.isInstanceOf[A]
for the actual A
type.
For example, if you are defining a NormalizedEquality[String]
, your isInstanceOf
method should look like:
def isInstanceOfA(b: Any) = b.isInstanceOf[String]
If you are defining a NormalizedEquality[xml.Node]
your isInstanceOf
method
should look like:
def isInstanceOfA(b: Any) = b.isInstanceOf[xml.Node]
the object to inspect to determine whether it is an instance of A
true if the passed object is an instance of A
Normalizes the passed object.
Normalizes the passed object.
the object to normalize
the normalized form of the passed object
Indicates whether the objects passed as a
and b
are equal by
first passing b
to the isInstanceOfA
method.
Indicates whether the objects passed as a
and b
are equal by
first passing b
to the isInstanceOfA
method. If isInstanceOfA
returns
true
, this method casts b
to type A
and passes that to normalized
to obtain b
in normalized form. This method then passes a
to normalized
, to
obtain a
in normalized form. Finally, this method invokes areEqual
on
DefaultEquality
, passing the normalized a
object, and either the normalized b
object, if b
was an instance of A
, else just the raw, unnormalized b
. This
method returns the result of that areEqual
invocation.
a left-hand-side object being compared with another (right-hand-side one) for equality
a right-hand-side object being compared with another (left-hand-side one) for equality
true if the passed objects are "equal," as defined by this Equality
instance@tparam A the type whose normalized equality is being defined
An
Equality
implementation that determines the equality of two objects by normalizing both objects, if possible, and then comparing the results using default equality (as defined by theareEqual
method ofDefaultEquality
).