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

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

public class StandardDocumentDistroComparator
extends java.lang.Object
implements SimilarityComparatorListener

This class implements the SimilarityComparatorListener interface, describing objects that can perform comparison between NGramDistroDocument objects, than contain n-gram graph edge information represented as distributions.

See Also:
Serialized Form

Constructor Summary
StandardDocumentDistroComparator()
          Creates a new instance of StandardComparator.
StandardDocumentDistroComparator(double dGraphImportance)
          Creates a new instance of StandardComparator, given the importance of the n-gram graph similarity in the calculation of overall similarity.
 
Method Summary
 GraphSimilarity getGraphSimilarity()
          Returns the graph similarity part of the overall similality measurement, performed for the last comparison.
 GraphSimilarity getHistogramSimilarity()
          Returns the graph similarity part of the overall similality measurement, performed for the last comparison.
 GraphSimilarity getSimilarityBetween(java.lang.Object oFirst, java.lang.Object oSecond)
          Returns the similarity of two given NGramDistroDocuments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardDocumentDistroComparator

public StandardDocumentDistroComparator()
Creates a new instance of StandardComparator.


StandardDocumentDistroComparator

public StandardDocumentDistroComparator(double dGraphImportance)
Creates a new instance of StandardComparator, given the importance of the n-gram graph similarity in the calculation of overall similarity.

Parameters:
dGraphImportance - A value between 0.0 and 1.0 indicating how important is the graph in the calculation. If zero, then only histogram information is used. If 1.0, then only graph information is used.
Method Detail

getSimilarityBetween

public GraphSimilarity getSimilarityBetween(java.lang.Object oFirst,
                                            java.lang.Object oSecond)
                                     throws java.io.InvalidClassException
Returns the similarity of two given NGramDistroDocuments.

Specified by:
getSimilarityBetween in interface SimilarityComparatorListener
Parameters:
oFirst - The first object participating in the similarity calculation. If not an NGramDistroDocument then an InvalidClassException is thrown.
oSecond - The first object participating in the similarity calculation. If not an NGramDistroDocument 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

getGraphSimilarity

public GraphSimilarity getGraphSimilarity()
Returns the graph similarity part of the overall similality measurement, performed for the last comparison.

Returns:
The graph similarity of the objects last evaluated.

getHistogramSimilarity

public GraphSimilarity getHistogramSimilarity()
Returns the graph similarity part of the overall similality measurement, performed for the last comparison.

Returns:
The histogram similarity of the objects last evaluated.