Interface Similarity
-
- All Superinterfaces:
Comparable<Similarity>
- All Known Subinterfaces:
DependencySimilarity
- All Known Implementing Classes:
DependencySimilarityImpl,SimilarityImpl
public interface Similarity extends Comparable<Similarity>
Represents a similarity value.The Similarity is a wrapper for a double value with two additional functionalities:
- All values are between 0.0 and 1.0 (inclusive)
- with
isValidValue()it is possible to check if it is a valid value.
Similarity values may result from the aggregation of several local similarities. For this purpose, this class also contains a list of local similarities that constitute the overall similarity. For instance, local similarities result from computations that involve a mapping of
DataObjects (e.g.,SetObject,AggregateObject, orNESTWorkflowObject).- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description static doubleVALUE_INVALID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfilterLocalSimilarities(double value)Recursively filters all local similarities of the given value.DataObjectgetCaseObject()ObjectgetInfo()List<Similarity>getLocalSimilarities()This method returns a list of all the local similarities that contribute to the overall similarity value.DataObjectgetQueryObject()StringgetSimilarityMeasure()doublegetValue()booleanhasSameValueAsIn(Similarity otherSimilarity)booleanisLessThan(Similarity otherSimilarity)booleanisValidValue()voidpruneLocalSimilarities(int depth)Prunes the tree of local similarities to the given depth.voidremoveLocalSimilaritiesWithNullMapping()Removes all local similarities with a null mapping, i.e., where a query object could not be mapped to a case object and thus is mapped to null.voidsortLocalSimilarities()Recursively sorts all local similarities in descending order.StringtoDetailedString()-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
VALUE_INVALID
static final double VALUE_INVALID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSimilarityMeasure
String getSimilarityMeasure()
- Returns:
- similarity measure
-
getInfo
Object getInfo()
- Returns:
- further infos
-
getQueryObject
DataObject getQueryObject()
- Returns:
- query element
-
getCaseObject
DataObject getCaseObject()
- Returns:
- case element
-
hasSameValueAsIn
boolean hasSameValueAsIn(Similarity otherSimilarity)
- Parameters:
otherSimilarity-- Returns:
-
getValue
double getValue()
- Returns:
- a double value between 0 and 1
-
isValidValue
boolean isValidValue()
- Returns:
- true if the computation was successful and a correct value between 0 and 1 will be returned by getValue()
-
isLessThan
boolean isLessThan(Similarity otherSimilarity)
- Returns:
- true if this similarity is valid, the other similarity is valid, and this similarity value is less than the other similarity value.
-
getLocalSimilarities
List<Similarity> getLocalSimilarities()
This method returns a list of all the local similarities that contribute to the overall similarity value.- Returns:
- a
<Similarity>of local similarities
-
filterLocalSimilarities
void filterLocalSimilarities(double value)
Recursively filters all local similarities of the given value.- Parameters:
value-
-
sortLocalSimilarities
void sortLocalSimilarities()
Recursively sorts all local similarities in descending order.
-
pruneLocalSimilarities
void pruneLocalSimilarities(int depth)
Prunes the tree of local similarities to the given depth.- Parameters:
depth-
-
removeLocalSimilaritiesWithNullMapping
void removeLocalSimilaritiesWithNullMapping()
Removes all local similarities with a null mapping, i.e., where a query object could not be mapped to a case object and thus is mapped to null. Usually, the local similarity is 0.0 in this case.
-
toDetailedString
String toDetailedString()
- Returns:
- detailed string representation
-
-