Class IRangeFinder

java.lang.Object
net.algart.math.IRangeFinder

public class IRangeFinder extends Object
  • Method Details

    • getEmptyInstance

      public static IRangeFinder getEmptyInstance()
    • getEmptyUnoptimizedInstance

      public static IRangeFinder getEmptyUnoptimizedInstance()
    • getInstance

      public static IRangeFinder getInstance(IntUnaryOperator left, IntUnaryOperator right, int numberOfRanges)
    • getInstance

      public static IRangeFinder getInstance(int[] left, int[] right)
    • left

      public final IntUnaryOperator left()
    • right

      public final IntUnaryOperator right()
    • left

      public final int left(int k)
    • right

      public final int right(int k)
    • numberOfRanges

      public final int numberOfRanges()
    • setRanges

      public final IRangeFinder setRanges(IntUnaryOperator left, IntUnaryOperator right, int numberOfRanges)
    • setRanges

      public final IRangeFinder setRanges(int[] left, int[] right)
    • setIndexedRanges

      public final IRangeFinder setIndexedRanges(int[] allLeft, int[] allRight, int[] indexes, int numberOfRanges)
    • setIndexActual

      public final IRangeFinder setIndexActual(IntPredicate indexActual)
      Allows to remove some ranges from finding, for example, if they were processed by some way and already not necessary. For such indexes, indexActual.test(index) should return false. By default, all indexes are actual (built-in indexActual always returns true).

      Note that this method should be very quick/ If it requires essential time, it is better to check actuality in the high-level processing.

      Parameters:
      indexActual - whether a range with the given index is necessary to be returned
      Returns:
      a reference to this object.
    • setAllIndexesActual

      public final IRangeFinder setAllIndexesActual()
    • indexActual

      public final boolean indexActual(int k)
    • compact

      public IRangeFinder compact()
    • findContaining

      public void findContaining(int point, IRangeConsumer rangeConsumer)
    • findContaining

      public void findContaining(int point, IntConsumer indexConsumer)
    • findContaining

      public int findContaining(int point, int[] resultIndexes)
    • findContaining

      public void findContaining(double point, IRangeConsumer rangeConsumer)
    • findContaining

      public void findContaining(double point, IntConsumer indexConsumer)
    • findContaining

      public int findContaining(double point, int[] resultIndexes)
    • findIntersecting

      public void findIntersecting(int min, int max, IRangeConsumer rangeConsumer)
    • findIntersecting

      public void findIntersecting(int min, int max, IntConsumer indexConsumer)
    • findIntersecting

      public int findIntersecting(int min, int max, int[] resultIndexes)
    • clear

      public void clear()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • unpackHigh

      public static int unpackHigh(long packed)
    • unpackLow

      public static int unpackLow(long packed)