Class YLongList


  • public class YLongList
    extends java.lang.Object
    List that can hold long primitives.
    • Constructor Summary

      Constructors 
      Constructor Description
      YLongList()
      Creates an empty list.
      YLongList​(int initalCapacity)
      Creates an empty list with preallocated initial space for elements.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long value)
      Add element to the list.
      long get​(int offset)
      Get element at given offset.
      int size()
      Returns number of elements in the list.
      • Methods inherited from class java.lang.Object

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

      • YLongList

        public YLongList()
        Creates an empty list.
      • YLongList

        public YLongList​(int initalCapacity)
        Creates an empty list with preallocated initial space for elements.
        Parameters:
        initalCapacity - initial capacity of the list
    • Method Detail

      • size

        public int size()
        Returns number of elements in the list.
        Returns:
        number of elements in the list
      • get

        public long get​(int offset)
        Get element at given offset.
        Parameters:
        offset - given offset
        Returns:
        element at given offset
        Throws:
        java.lang.IndexOutOfBoundsException - when offset is out of bound
      • add

        public void add​(long value)
        Add element to the list.
        Parameters:
        value - value to be add at the end of the list