Class SimilarityImpl

    • Constructor Detail

      • SimilarityImpl

        public SimilarityImpl​(SimilarityMeasure similarityMeasure,
                              DataObject queryObject,
                              DataObject caseObject)
        Creates a similarity object with an invalid similarity value.
        Parameters:
        similarityMeasure -
        queryObject -
        caseObject -
      • SimilarityImpl

        public SimilarityImpl​(SimilarityMeasure similarityMeasure,
                              DataObject queryObject,
                              DataObject caseObject,
                              double value)
        Creates a similarity object with based on a given similarity value.
        Parameters:
        similarityMeasure -
        queryObject -
        caseObject -
        value -
      • SimilarityImpl

        public SimilarityImpl​(SimilarityMeasure similarityMeasure,
                              DataObject queryObject,
                              DataObject caseObject,
                              double value,
                              ArrayList<Similarity> localSimilarities)
        Creates a similarity object with based on a given similarity value.
        Parameters:
        similarityMeasure -
        queryObject -
        caseObject -
        value -
        localSimilarities -
      • SimilarityImpl

        public SimilarityImpl​(SimilarityMeasure similarityMeasure,
                              DataObject queryObject,
                              DataObject caseObject,
                              double value,
                              ArrayList<Similarity> localSimilarities,
                              Object info)
        Creates a similarity object with based on a given similarity value.
        Parameters:
        similarityMeasure -
        queryObject -
        caseObject -
        value -
        localSimilarities -
        info -
    • Method Detail

      • hasSameValueAsIn

        public boolean hasSameValueAsIn​(Object otherSimilarity)
      • hasSameValueAsIn

        public boolean hasSameValueAsIn​(Similarity otherSimilarity)
      • getValue

        public double getValue()
        Specified by:
        getValue in interface Similarity
        Returns:
        a double value between 0 and 1
      • setValue

        public void setValue​(double value)
      • hashCode

        public int hashCode()
        Returns a hash code for this Double object. The result is the exclusive OR of the two halves of the long integer bit representation, exactly as produced by the method Double.doubleToLongBits(double), of the primitive double value represented by this Double object. That is, the hash code is the value of the expression:
         (int) (v ˆ (v >>> 32))
         

        where v is defined by:

         long v = Double.doubleToLongBits(this.doubleValue());
         
        Overrides:
        hashCode in class Object
        Returns:
        a hash code value for this object.
      • isLessThan

        public boolean isLessThan​(Similarity otherSimilarity)
        Specified by:
        isLessThan in interface Similarity
        Returns:
        true if this similarity is valid, the other similarity is valid, and this similarity value is less than the other similarity value.
      • isValidValue

        public boolean isValidValue()
        Specified by:
        isValidValue in interface Similarity
        Returns:
        true if the computation was successful and a correct value between 0 and 1 will be returned by getValue()
      • setInvalidValue

        public void setInvalidValue()
      • setQueryObject

        public void setQueryObject​(DataObject queryObject)
      • setCaseObject

        public void setCaseObject​(DataObject caseObject)
      • getLocalSimilarities

        public List<Similarity> getLocalSimilarities()
        Description copied from interface: Similarity
        This method returns a list of all the local similarities that contribute to the overall similarity value.
        Specified by:
        getLocalSimilarities in interface Similarity
        Returns:
        a <Similarity> of local similarities
      • setLocalSimilarities

        public void setLocalSimilarities​(ArrayList<Similarity> localSimilarities)
      • filterLocalSimilarities

        public void filterLocalSimilarities​(double value)
        Description copied from interface: Similarity
        Recursively filters all local similarities of the given value.
        Specified by:
        filterLocalSimilarities in interface Similarity
      • removeLocalSimilaritiesWithNullMapping

        public void removeLocalSimilaritiesWithNullMapping()
        Description copied from interface: Similarity
        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.
        Specified by:
        removeLocalSimilaritiesWithNullMapping in interface Similarity
      • sortLocalSimilarities

        public void sortLocalSimilarities()
        Description copied from interface: Similarity
        Recursively sorts all local similarities in descending order.
        Specified by:
        sortLocalSimilarities in interface Similarity
      • pruneLocalSimilarities

        public void pruneLocalSimilarities​(int depth)
        Description copied from interface: Similarity
        Prunes the tree of local similarities to the given depth.
        Specified by:
        pruneLocalSimilarities in interface Similarity
      • setSimilarityMeasure

        public void setSimilarityMeasure​(SimilarityMeasure similarityMeasure)
      • setInfo

        public void setInfo​(Object info)