Class BoundsChecker

  • Direct Known Subclasses:
    BoundsChecker.Max, BoundsChecker.Min

    public abstract class BoundsChecker
    extends java.lang.Object
    A helper class for an hnsw graph that serves as a comparator of the currently set bound value with a new value.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BoundsChecker.Max
      A helper class for an hnsw graph that serves as a comparator of the currently set maximum value with a new value.
      static class  BoundsChecker.Min
      A helper class for an hnsw graph that serves as a comparator of the currently set minimum value with a new value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) float bound  
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundsChecker()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean check​(float sample)  
      static BoundsChecker create​(boolean reversed)  
      void set​(float sample)
      Update the bound unconditionally
      abstract void update​(float sample)
      Update the bound if sample is better
      • Methods inherited from class java.lang.Object

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

      • bound

        float bound
    • Constructor Detail

      • BoundsChecker

        public BoundsChecker()
    • Method Detail

      • update

        public abstract void update​(float sample)
        Update the bound if sample is better
      • set

        public void set​(float sample)
        Update the bound unconditionally
      • check

        public abstract boolean check​(float sample)
        Returns:
        whether the sample exceeds (is worse than) the bound
      • create

        public static BoundsChecker create​(boolean reversed)