gr.demokritos.iit.jinsect.documentModel.comparators
Class CachedDocumentComparator

java.lang.Object
  extended by gr.demokritos.iit.jinsect.documentModel.comparators.StandardDocumentComparator
      extended by gr.demokritos.iit.jinsect.documentModel.comparators.CachedDocumentComparator
All Implemented Interfaces:
NotificationListener, SimilarityComparatorListener, java.io.Serializable

public class CachedDocumentComparator
extends StandardDocumentComparator
implements NotificationListener

An optimized document comparator that uses cached edge information (via NGramCachedGraphComparator) for the graph comparison process.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gr.demokritos.iit.jinsect.documentModel.comparators.StandardDocumentComparator
GraphImportance, sGraph, sHistogram
 
Constructor Summary
CachedDocumentComparator()
          Creates an instance of CachedDocumentComparator, using default importance for graph and histogram (0.5).
CachedDocumentComparator(double dGraphImportance)
           
 
Method Summary
 GraphSimilarity getSimilarityBetween(java.lang.Object oFirst, java.lang.Object oSecond)
          Returns the similarity of two given NGramDocuments.
 void Notify(java.lang.Object oSender, java.lang.Object oParams)
          Acts as a notifier, outputting debug information to the standard error, indicative of the comparison progress.
 
Methods inherited from class gr.demokritos.iit.jinsect.documentModel.comparators.StandardDocumentComparator
getGraphSimilarity, getHistogramSimilarity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedDocumentComparator

public CachedDocumentComparator()
Creates an instance of CachedDocumentComparator, using default importance for graph and histogram (0.5).


CachedDocumentComparator

public CachedDocumentComparator(double dGraphImportance)
Method Detail

getSimilarityBetween

public GraphSimilarity getSimilarityBetween(java.lang.Object oFirst,
                                            java.lang.Object oSecond)
                                     throws java.io.InvalidClassException
Description copied from class: StandardDocumentComparator
Returns the similarity of two given NGramDocuments.

Specified by:
getSimilarityBetween in interface SimilarityComparatorListener
Overrides:
getSimilarityBetween in class StandardDocumentComparator
Parameters:
oFirst - The first object participating in the similarity calculation. If not an NGramDocument then an InvalidClassException is thrown.
oSecond - The first object participating in the similarity calculation. If not an NGramDocument then an InvalidClassException is thrown.
Returns:
A GraphSimilarity object indicating the similarity between the two given objects.
Throws:
java.io.InvalidClassException - Throws this exception when the objects are not comparable due to class restrictions.
See Also:
ISimilarity

Notify

public void Notify(java.lang.Object oSender,
                   java.lang.Object oParams)
Acts as a notifier, outputting debug information to the standard error, indicative of the comparison progress.

Specified by:
Notify in interface NotificationListener
Parameters:
oSender - The sender of the notification.
oParams - The parameter object containing a Double number (0.0 to 1.0), that indicated the percentile progress of the process.