de.hpi.fgis.dude.similarityfunction.contentbased.calculationstrategy
Class IgnoreStrategy<T1 extends JsonValue,T2 extends JsonValue>

java.lang.Object
  extended by de.hpi.fgis.dude.similarityfunction.contentbased.calculationstrategy.IgnoreStrategy<T1,T2>
Type Parameters:
T1 - The type of the first value.
T2 - The type of the second value.
All Implemented Interfaces:
CalculationStrategy<T1,T2>

public class IgnoreStrategy<T1 extends JsonValue,T2 extends JsonValue>
extends Object
implements CalculationStrategy<T1,T2>

IgnoreStrategy ignores the actual values and returns always the same default similarity. The number of times this strategy was used can be reviewed using getCallCount().

Author:
Matthias Pohl

Constructor Summary
IgnoreStrategy()
          Initializes a IgnoreStrategy that returns a default similarity of 0.0.
IgnoreStrategy(double defSimilarity)
          Initializes a IgnoreStrategy that returns the passed default similarity.
 
Method Summary
 double calculateSimilarity(ContentBasedSimilarityFunction<?> similarityFunction, T1 value1, T2 value2)
          Calculates the similarity of the passed values.
 int getCallCount()
          Returns the current call count.
 void resetCallCount()
          Resets the call count.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnoreStrategy

public IgnoreStrategy()
Initializes a IgnoreStrategy that returns a default similarity of 0.0.


IgnoreStrategy

public IgnoreStrategy(double defSimilarity)
Initializes a IgnoreStrategy that returns the passed default similarity.

Parameters:
defSimilarity - The similarity that shall be returned by any call of calculateSimilarity(ContentBasedSimilarityFunction, JsonValue, JsonValue).
Method Detail

calculateSimilarity

public double calculateSimilarity(ContentBasedSimilarityFunction<?> similarityFunction,
                                  T1 value1,
                                  T2 value2)
Description copied from interface: CalculationStrategy
Calculates the similarity of the passed values.

Specified by:
calculateSimilarity in interface CalculationStrategy<T1 extends JsonValue,T2 extends JsonValue>
Parameters:
similarityFunction - The SimilarityFunction that is used for atomic values within this strategy.
value1 - The first value.
value2 - The second value.
Returns:
Returns the similarity of the passed values.

getCallCount

public int getCallCount()
Returns the current call count.

Returns:
The current call count.

resetCallCount

public void resetCallCount()
Resets the call count.



Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.