|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.collections.fuzzy.FuzzyFingerPrint<T>
public abstract class FuzzyFingerPrint<T>
A FuzzyFingerPrint
represents kind of a signature of its
wrapped object of type T
which can be used for fuzzy
comparisons.
FuzzyFingerPrint
s should be much smaller in terms of memory
consumption than their wrapped content objects.
Note: Concrete FuzzyFingerPrint
classes must provide a
public default constructor. If not getInstance(Class, Object)
will throw a InvocationTargetException
or some similar,
maybe unchecked, reflection originated exception.
FuzzyFingerPrint
s must be Serializable
.
FuzzyComparable
,
FuzzyComparator
,
Serialized FormField Summary | |
---|---|
protected T |
content
|
Constructor Summary | |
---|---|
FuzzyFingerPrint()
|
Method Summary | ||
---|---|---|
abstract float |
compare(FuzzyFingerPrint<T> o1,
FuzzyFingerPrint<T> o2)
Compares its two arguments for similarity. |
|
abstract float |
compareTo(FuzzyFingerPrint<T> o)
Compares its two arguments for similarity. |
|
T |
getContent()
|
|
static
|
getInstance(java.lang.Class<? extends FuzzyFingerPrint<T>> clazz,
T newContent)
Factory method. |
|
protected abstract void |
init()
Initializes the FuzzyFingerPrint . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T content
Constructor Detail |
---|
public FuzzyFingerPrint()
Method Detail |
---|
public static <T> FuzzyFingerPrint<T> getInstance(java.lang.Class<? extends FuzzyFingerPrint<T>> clazz, T newContent) throws FingerPrintException
Ensure that clazz implements a public default constructor.
T
- clazz
- newContent
-
java.lang.InstantiationException
java.lang.IllegalAccessException
FingerPrintException
public T getContent()
protected abstract void init() throws java.lang.NullPointerException
FuzzyFingerPrint
.
Called by getInstance(Class, Object)
.
java.lang.NullPointerException
- - if content
is null
public abstract float compare(FuzzyFingerPrint<T> o1, FuzzyFingerPrint<T> o2)
FuzzyComparator
The implementor should strive for ensuring that the following properties:
Furthermore compare(x, y) must throw an exception iff compare(y, x) throws an exception.
It is strongly recommended (though not required) that the comparison is consistent with equals. So it is generally the case, but not strictly required that (compare(x, y)==1) == (x.equals(y)). Generally speaking, any comparator that violates this condition should clearly indicate this fact.
compare
in interface FuzzyComparator<FuzzyFingerPrint<T>>
o1
- the first object to be compared.o2
- the second object to be compared.
FuzzyComparator.compare(java.lang.Object, java.lang.Object)
public abstract float compareTo(FuzzyFingerPrint<T> o)
FuzzyComparable
The implementor should strive for ensuring that the following properties:
Furhtermore compare(x, y) must throw an exception iff compare(y, x) throws an exception.
It is strongly recommended (though not required) that the comparison is consistent with equals. So it is generally the case, but not strictly required that (compare(x, y)==1) == (x.equals(y)). Generally speaking, any comparator that violates this condition should clearly indicate this fact.
compareTo
in interface FuzzyComparable<FuzzyFingerPrint<T>>
FuzzyComparable.compareTo(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |