Class DistanceResultAdapter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected DoubleDBIDListIter iter
      Original iterator
      protected double prevDist
      Distance of previous.
      private DBIDs set
      Set of positive examples.
      private int size
      Number of IDs
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DistanceResultAdapter advance()
      Moves the iterator forward to the next entry.
      int numPositive()
      Return the number of positive ids.
      int numTotal()
      Return the number of all ids.
      boolean test()
      True if the current object is a positive example.
      boolean tiedToPrevious()
      Test whether the score is the same as the previous objects score.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • set

        private DBIDs set
        Set of positive examples.
      • size

        private int size
        Number of IDs
      • prevDist

        protected double prevDist
        Distance of previous.
    • Constructor Detail

      • DistanceResultAdapter

        public DistanceResultAdapter​(DBIDs set,
                                     DoubleDBIDListIter iter,
                                     int size)
        Constructor
        Parameters:
        set - Set of positive examples
        iter - Iterator for distance results
        size - Number of IDs
    • Method Detail

      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public DistanceResultAdapter advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.
      • tiedToPrevious

        public boolean tiedToPrevious()
        Description copied from interface: ScoreEvaluation.Adapter
        Test whether the score is the same as the previous objects score. When there is no previous result, implementations should return false!
        Specified by:
        tiedToPrevious in interface ScoreEvaluation.Adapter
        Returns:
        Boolean