org.egothor.duplicity.datastructure
Class JaccardCoeficient

java.lang.Object
  extended by org.egothor.duplicity.file.DuplicityCheckingFileElement
      extended by 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.
 
Constructor Summary
JaccardCoeficient()
           
JaccardCoeficient(TextUnitID first, TextUnitID second, int jaccard)
           
JaccardCoeficient(UnitPair similarUnitPair, int jaccard)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getJaccard()
           
 UnitPair getSimilarUnitPair()
           
 int hashCode()
           
 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.
 void load(DataInputStream dis)
           
 void set(UnitPair similarUnitPair, int jaccard)
           
 void setJaccard(int jaccard)
           
 void setSimilarUnitPair(UnitPair similarUnitPair)
           
 void store(DataOutputStream dos)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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.

Constructor Detail

JaccardCoeficient

public JaccardCoeficient()

JaccardCoeficient

public JaccardCoeficient(UnitPair similarUnitPair,
                         int jaccard)

JaccardCoeficient

public JaccardCoeficient(TextUnitID first,
                         TextUnitID second,
                         int jaccard)
Method Detail

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