An instance of
AttrImpl
can act as an
OMAttribute
and as well as an
org.w3c.dom.Attr
. So we first check if the object to compare with (
obj
)
is of type
OMAttribute
(this includes instances of
OMAttributeImpl
or
AttrImpl
(instances of this class)). If so we check for the equality
of namespaces first (note that if the namespace of this instance is null then for the
obj
to be equal its namespace must also be null). This condition solely doesn't determine the equality.
So we check for the equality of names and values (note that the value can also be null in which case
the same argument holds as that for the namespace) of the two instances. If all three conditions are
met then we say the two instances are equal.
If obj
is of type org.w3c.dom.Attr
then we perform the same equality check
as before. Note that, however, the implementation of the test for equality in this case is little different
than before.
If obj
is neither of type OMAttribute
nor of type org.w3c.dom.Attr
then we return false.