org.egothor.duplicity.datastructure
Class JaccardCoeficient
java.lang.Object
org.egothor.duplicity.file.DuplicityCheckingFileElement
org.egothor.duplicity.datastructure.JaccardCoeficient
public class JaccardCoeficient extends DuplicityCheckingFileElement
Represents pair of two documents together with its Jaccard coeficient.
Author:
Kate�ina Dufkov�
Field Summary
static java.util.Comparator<JaccardCoeficient >
comp
Comparator using first and then second unit id of the similarUnitPair field
for the class JaccardCoeficient.
static java.util.Comparator<JaccardCoeficient >
compJaccard
Comparator using jaccard
field for the class JaccardCoeficient.
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comp
public static java.util.Comparator<JaccardCoeficient > comp
Comparator using first and then second unit id of the similarUnitPair field
for the class JaccardCoeficient.
compJaccard
public static java.util.Comparator<JaccardCoeficient > compJaccard
Comparator using jaccard
field for the class JaccardCoeficient.
JaccardCoeficient
public JaccardCoeficient ()
JaccardCoeficient
public JaccardCoeficient (UnitPair similarUnitPair,
int jaccard)
JaccardCoeficient
public JaccardCoeficient (TextUnitID first,
TextUnitID second,
int jaccard)
getJaccard
public int getJaccard ()
getSimilarUnitPair
public UnitPair getSimilarUnitPair ()
setJaccard
public void setJaccard (int jaccard)
setSimilarUnitPair
public void setSimilarUnitPair (UnitPair similarUnitPair)
set
public void set (UnitPair similarUnitPair,
int jaccard)
equals
public boolean equals (java.lang.Object obj)
Overrides: equals
in class java.lang.Object
hashCode
public int hashCode ()
Overrides: hashCode
in class java.lang.Object
toString
public java.lang.String toString ()
Overrides: toString
in class java.lang.Object
store
public void store (DataOutputStream dos)
throws java.io.IOException
Specified by: store
in class DuplicityCheckingFileElement
Throws:
java.io.IOException
load
public void load (DataInputStream dis)
throws java.io.IOException
Specified by: load
in class DuplicityCheckingFileElement
Throws:
java.io.IOException
isRelatedTo
public boolean isRelatedTo (java.util.Set<DocumentUnitID > set)
Returns true, if one of the documents related to this Jaccard coeficient
is present in the given set of documents.
Specified by: isRelatedTo
in class DuplicityCheckingFileElement
Parameters: set
- set of document identificators
Returns: true, if one of the documents related to this Jaccard coeficient
is present in the given set of documents