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, or NESTWorkflowObject).

Author:
Rainer Maximini
  • Field Details

  • 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

      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
    • getLocalSimilarity

      Similarity getLocalSimilarity(DataObject queryObject, DataObject caseObject)
      Recursively searches for the local similarity of the given query and case object
      Parameters:
      queryObject - query
      caseObject - 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