Interface Similarity
- All Superinterfaces:
Comparable<Similarity>
- All Known Subinterfaces:
DependencySimilarity
- All Known Implementing Classes:
DependencySimilarityImpl
,SimilarityImpl
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
DataObject
s (e.g., SetObject
, AggregateObject
, or NESTWorkflowObject
).
- Author:
- Rainer Maximini
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
filterLocalSimilarities
(double value) Recursively filters all local similarities of the given value.long
getInfo()
This method returns a list of all the local similarities that contribute to the overall similarity value.getLocalSimilarity
(DataObject queryObject, DataObject caseObject) Recursively searches for the local similarity of the given query and case objectdouble
getValue()
boolean
hasSameValueAsIn
(Similarity otherSimilarity) boolean
isLessThan
(Similarity otherSimilarity) boolean
void
pruneLocalSimilarities
(int depth) Prunes the tree of local similarities to the given depth.void
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.void
Recursively sorts all local similarities in descending order.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
VALUE_INVALID
static final double VALUE_INVALID- See Also:
-
-
Method Details
-
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
- 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
- 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
-
getLocalSimilarity
Recursively searches for the local similarity of the given query and case object- Parameters:
queryObject
- querycaseObject
- case- Returns:
- local similarity of the given objects
-
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
-
getComputationTimeNanos
long getComputationTimeNanos()- Returns:
- computation time of this similarity in nanoseconds
-