|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of elementspublic interface Equalitor<T>
Equalitor
defines an interface for an
abstraction of the equals
and hashCode
methods.
Method Summary | |
---|---|
boolean |
equals(T a,
T b)
Returns true if the elements a and b are equal
according to this {link Equalitor}. |
int |
hashCode(T a)
Returns the hashcode for the element a according to this
Equalitor . |
Method Detail |
---|
boolean equals(T a, T b)
true
if the elements a
and b
are equal
according to this {link Equalitor}. If the elements are equal, then
we must have hashCode(a) == hashCode(b)
. The method must handle
the case where a
or b
is null
.
The equality relation must atleast be reflexive in the object reference,
i.e. for all elements e
we must have equals(e,e)==true
.
a
- the first elementb
- the second element
true
if a
and b
are equalint hashCode(T a)
a
according to this
Equalitor
. If equals(Object,Object)
returns
true
, for two elements a
and b
, then for
hashCode
we must have hashCode(a) == hashCode(b)
.
The method must handle the case where a
is null
.
a
- the element
a
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |