Class LongArray


  • public class LongArray
    extends Object
    long array
    • Field Detail

      • DEFAULT_CAPACITY

        public static int DEFAULT_CAPACITY
    • Constructor Detail

      • LongArray

        public LongArray()
        Creates a sorted int array with a default initial capacity
      • LongArray

        public LongArray​(int capacity)
        Creates an IntArray with a given initial capacity
        Parameters:
        capacity -
    • Method Detail

      • wrap

        public static LongArray wrap​(long... array)
        Creates the IntArray with the backing array
        Parameters:
        array -
      • add

        public void add​(long x)
        add value to the array
        Parameters:
        x - - value to be added
      • add

        public void add​(int pos,
                        long x)
      • get

        public long get​(int pos)
        get element at position
        Parameters:
        pos -
        Returns:
      • isEmpty

        public boolean isEmpty()
      • toArray

        public long[] toArray()
      • size

        public int size()
      • set

        public void set​(int pos,
                        long x)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • array

        public long[] array()
        get the backing array. It's length will be ≥ than the size of the array.
        Returns: