|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectcom.koloboke.collect.Equivalence<T>
com.koloboke.collect.StatelessEquivalence<T>
public abstract class StatelessEquivalence<T>
Base class for stateless Equivalence
implementations.
StatelessEquivalence
relies on the fact that your equivalence class,
which extend it, don't have subclasses in turn, therefore it is strongly recommended to declare
your equivalence class as final
.
Override toString()
if implementation is anonymous and you want to log
or pretty print it, because otherwise String
representation of your equivalence
would be ""
(empty String
).
See example implementations in the documentation to identity and case insensitive equivalences.
Constructor Summary | |
---|---|
protected |
StatelessEquivalence()
Constructor for use by subclasses. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true if the given object is also an instance of this equivalence class. |
int |
hashCode()
Returns a hash code of this equivalence class. |
String |
toString()
Returns simple name of this equivalence class, getClass().getSimpleName() . |
Methods inherited from class com.koloboke.collect.Equivalence |
---|
caseInsensitive, charSequence, defaultEquality, entryEquivalence, equivalent, hash, identity, nullableEquivalent, nullableHash |
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected StatelessEquivalence()
Method Detail |
---|
public boolean equals(Object o)
true
if the given object is also an instance of this equivalence class.
equals
in class Equivalence<T>
o
- the reference object with which to compare.
Object.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Equivalence<T>
Object.equals(java.lang.Object)
,
Hashtable
public String toString()
getClass().getSimpleName()
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |