Class SmartArrayInt


  • @Immutable
    public class SmartArrayInt
    extends Object
    integer array in which we want to quickly find the index for a given value. optimize for the case of 1) constant, 2) sequential, 3) sorted
    Since:
    11/4/2014
    • Constructor Detail

      • SmartArrayInt

        public SmartArrayInt​(int[] raw)
    • Method Detail

      • get

        public int get​(int idx)
      • getN

        public int getN()
      • findIdx

        public int findIdx​(int want)
        Find which index holds the value want
        Parameters:
        want - value wanted
        Returns:
        < 0 if not found, else the index. If duplicates, then return any match