Class Index

java.lang.Object
com.landawn.abacus.util.Index

public final class Index extends Object
  • Method Details

    • of

      public static u.OptionalInt of(boolean[] a, boolean valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(boolean[] a, int startIndex, boolean valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(char[] a, int startIndex, char valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(byte[] a, int startIndex, byte valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(short[] a, int startIndex, short valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(int[] a, int startIndex, int valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(long[] a, int startIndex, long valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(float[] a, int startIndex, float valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(double[] a, int startIndex, double valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(double[] a, double valueToFind, double tolerance)
      Parameters:
      a -
      valueToFind -
      tolerance -
      Returns:
      See Also:
      • CommonUtil.indexOf(double[], double, double)
    • of

      public static u.OptionalInt of(double[] a, int startIndex, double valueToFind, double tolerance)
      Parameters:
      a -
      startIndex -
      valueToFind -
      tolerance -
      Returns:
      See Also:
      • CommonUtil.indexOf(double[], int, double, double)
    • of

      public static u.OptionalInt of(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(Object[] a, int startIndex, Object valueToFind)
      Parameters:
      a -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(Collection<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(Collection<?> c, int startIndex, Object valueToFind)
      Parameters:
      c -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(Iterator<?> iter, Object valueToFind)
      Parameters:
      iter -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(Iterator<?> iter, int startIndex, Object valueToFind)
      Parameters:
      iter -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(String str, int valueToFind)
      Parameters:
      str -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(String str, int startIndex, int valueToFind)
      Parameters:
      str -
      startIndex -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(String str, String valueToFind)
      Parameters:
      str -
      valueToFind -
      Returns:
    • of

      public static u.OptionalInt of(String str, int startIndex, String valueToFind)
      Parameters:
      str -
      startIndex -
      valueToFind -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(boolean[] sourceArray, boolean[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(boolean[] sourceArray, int startIndex, boolean[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(boolean[] sourceArray, int startIndex, boolean[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(char[] sourceArray, char[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(char[] sourceArray, int startIndex, char[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(char[] sourceArray, int startIndex, char[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(byte[] sourceArray, byte[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(byte[] sourceArray, int startIndex, byte[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(byte[] sourceArray, int startIndex, byte[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(short[] sourceArray, short[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(short[] sourceArray, int startIndex, short[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(short[] sourceArray, int startIndex, short[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(int[] sourceArray, int[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(int[] sourceArray, int startIndex, int[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(int[] sourceArray, int startIndex, int[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(long[] sourceArray, long[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(long[] sourceArray, int startIndex, long[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(long[] sourceArray, int startIndex, long[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(float[] sourceArray, float[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(float[] sourceArray, int startIndex, float[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(float[] sourceArray, int startIndex, float[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(double[] sourceArray, double[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(double[] sourceArray, int startIndex, double[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(double[] sourceArray, int startIndex, double[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubArray

      public static u.OptionalInt ofSubArray(Object[] sourceArray, Object[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(Object[] sourceArray, int startIndex, Object[] subArrayToFind)
    • ofSubArray

      public static u.OptionalInt ofSubArray(Object[] sourceArray, int startIndex, Object[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Of sub array.
      Parameters:
      sourceArray -
      startIndex -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • ofSubList

      public static u.OptionalInt ofSubList(List<?> sourceList, List<?> subListToFind)
    • ofSubList

      public static u.OptionalInt ofSubList(List<?> sourceList, int startIndex, List<?> subListToFind)
    • ofSubList

      public static u.OptionalInt ofSubList(List<?> sourceList, int startIndex, List<?> subListToFind, int beginIndexOfTargetSubList, int size)
      Of sub list.
      Parameters:
      sourceList -
      startIndex -
      subListToFind -
      beginIndexOfTargetSubList -
      size -
      Returns:
    • last

      public static u.OptionalInt last(boolean[] a, boolean valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(boolean[] a, int startIndexFromBack, boolean valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(char[] a, int startIndexFromBack, char valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(byte[] a, int startIndexFromBack, byte valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(short[] a, int startIndexFromBack, short valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(int[] a, int startIndexFromBack, int valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(long[] a, int startIndexFromBack, long valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(float[] a, int startIndexFromBack, float valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(double[] a, int startIndexFromBack, double valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(double[] a, double valueToFind, double tolerance)
      Parameters:
      a -
      valueToFind -
      tolerance -
      Returns:
      See Also:
      • CommonUtil.lastIndexOf(double[], double, double)
    • last

      public static u.OptionalInt last(double[] a, int startIndexFromBack, double valueToFind, double tolerance)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      tolerance -
      Returns:
      See Also:
      • CommonUtil.lastIndexOf(double[], int, double, double)
    • last

      public static u.OptionalInt last(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(Object[] a, int startIndexFromBack, Object valueToFind)
      Parameters:
      a -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(Collection<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(Collection<?> c, int startIndexFromBack, Object valueToFind)
      Parameters:
      c -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(String str, int valueToFind)
      Parameters:
      str -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(String str, int startIndexFromBack, int valueToFind)
      Parameters:
      str -
      startIndexFromBack -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(String str, String valueToFind)
      Parameters:
      str -
      valueToFind -
      Returns:
    • last

      public static u.OptionalInt last(String str, int startIndexFromBack, String valueToFind)
      Parameters:
      str -
      startIndexFromBack -
      valueToFind -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(boolean[] sourceArray, boolean[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(boolean[] sourceArray, int startIndexFromBack, boolean[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(boolean[] sourceArray, int startIndexFromBack, boolean[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(char[] sourceArray, char[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(char[] sourceArray, int startIndexFromBack, char[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(char[] sourceArray, int startIndexFromBack, char[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(byte[] sourceArray, byte[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(byte[] sourceArray, int startIndexFromBack, byte[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(byte[] sourceArray, int startIndexFromBack, byte[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(short[] sourceArray, short[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(short[] sourceArray, int startIndexFromBack, short[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(short[] sourceArray, int startIndexFromBack, short[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(int[] sourceArray, int[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(int[] sourceArray, int startIndexFromBack, int[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(int[] sourceArray, int startIndexFromBack, int[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(long[] sourceArray, long[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(long[] sourceArray, int startIndexFromBack, long[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(long[] sourceArray, int startIndexFromBack, long[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(float[] sourceArray, float[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(float[] sourceArray, int startIndexFromBack, float[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(float[] sourceArray, int startIndexFromBack, float[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(double[] sourceArray, double[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(double[] sourceArray, int startIndexFromBack, double[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(double[] sourceArray, int startIndexFromBack, double[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(Object[] sourceArray, Object[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(Object[] sourceArray, int startIndexFromBack, Object[] subArrayToFind)
    • lastOfSubArray

      public static u.OptionalInt lastOfSubArray(Object[] sourceArray, int startIndexFromBack, Object[] subArrayToFind, int beginIndexOfTargetSubArray, int size)
      Last of sub array.
      Parameters:
      sourceArray -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubArray -
      size -
      Returns:
    • lastOfSubList

      public static u.OptionalInt lastOfSubList(List<?> sourceList, List<?> subListToFind)
    • lastOfSubList

      public static u.OptionalInt lastOfSubList(List<?> sourceList, int startIndexFromBack, List<?> subListToFind)
    • lastOfSubList

      public static u.OptionalInt lastOfSubList(List<?> sourceList, int startIndexFromBack, List<?> subArrayToFind, int beginIndexOfTargetSubList, int size)
      Last of sub list.
      Parameters:
      sourceList -
      startIndexFromBack -
      subArrayToFind -
      beginIndexOfTargetSubList -
      size -
      Returns:
    • allOf

      public static BitSet allOf(boolean[] a, boolean valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(boolean[] a, int startIndex, boolean valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet (-1).

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(byte[] a, byte valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(byte[] a, int startIndex, byte valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(char[] a, char valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(char[] a, int startIndex, char valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(short[] a, short valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(short[] a, int startIndex, short valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(int[] a, int valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(int[] a, int startIndex, int valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(long[] a, long valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(long[] a, int startIndex, long valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(float[] a, float valueToFind)
      Finds the indices of the given value in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(float[] a, int startIndex, float valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(double[] a, double valueToFind)
      Finds the indices of the given value in the array.

      This method returns empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(double[] a, int startIndex, double valueToFind)
      Finds the indices of the given value in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      Returns:
      a BitSet of the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(double[] a, double valueToFind, double tolerance)
      Finds the indices of the given value within a given tolerance in the array.

      This method will return all the indices of the value which fall between the region defined by valueToFind - tolerance and valueToFind + tolerance, each time between the nearest integers.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      Returns:
      a BitSet of all the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(double[] a, int startIndex, double valueToFind, double tolerance)
      Finds the indices of the given value in the a starting at the given index.

      This method will return the indices of the values which fall between the region defined by valueToFind - tolerance and valueToFind + tolerance, between the nearest integers.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind -
      tolerance - tolerance of the search
      Returns:
      a BitSet of the indices of the value within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(Object[] a, Object valueToFind)
      Finds the indices of the given object in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      a - the a to search through for the object, may be null
      valueToFind - the object to find, may be null
      Returns:
      a BitSet of all the indices of the object within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(Object[] a, int startIndex, Object valueToFind)
      Finds the indices of the given object in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      a - the a to search through for the object, may be null
      startIndex - the index to start searching at
      valueToFind - the object to find, may be null
      Returns:
      a BitSet of all the indices of the object within the a starting at the index, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(Collection<?> c, Object valueToFind)
      Finds the indices of the given object in the array.

      This method returns an empty BitSet for a null input array.

      Parameters:
      valueToFind - the object to find, may be null
      a - the a to search through for the object, may be null
      Returns:
      a BitSet of all the indices of the object within the a, an empty BitSet if not found or null a input
      Since:
      3.10
    • allOf

      public static BitSet allOf(Collection<?> c, int startIndex, Object valueToFind)
      Finds the indices of the given object in the a starting at the given index.

      This method returns an empty BitSet for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the a length will return an empty BitSet.

      Parameters:
      startIndex - the index to start searching at
      valueToFind - the object to find, may be null
      a - the a to search through for the object, may be null
      Returns:
      a BitSet of all the indices of the object within the a starting at the index, an empty BitSet if not found or null a input
      Since:
      3.10