Class TLongArrayList

    • Field Summary

      Fields

      Modifier and Type Field and Description
      protected long[] _data
      the data of the list
      protected int _pos
      the index after the last entry in the list
      protected static int DEFAULT_CAPACITY
      the default capacity for new lists
      protected long no_entry_value
      the long value that represents null
    • Constructor Summary

      Constructors

      Modifier Constructor and Description
        TLongArrayList()
      Creates a new TLongArrayList instance with the default capacity.
        TLongArrayList(int capacity)
      Creates a new TLongArrayList instance with the specified capacity.
        TLongArrayList(int capacity, long no_entry_value)
      Creates a new TLongArrayList instance with the specified capacity.
        TLongArrayList(long[] values)
      Creates a new TLongArrayList instance whose capacity is the length of values array and whose initial contents are the specified values.
      protected TLongArrayList(long[] values, long no_entry_value, boolean wrap)
       
        TLongArrayList(TLongCollection collection)
      Creates a new TLongArrayList instance that contains a copy of the collection passed to us.
    • Field Detail

      • _data

        protected long[] _data
        the data of the list
      • _pos

        protected int _pos
        the index after the last entry in the list
      • DEFAULT_CAPACITY

        protected static final int DEFAULT_CAPACITY
        the default capacity for new lists
        See Also:
        Constant Field Values
      • no_entry_value

        protected long no_entry_value
        the long value that represents null
    • Constructor Detail

      • TLongArrayList

        public TLongArrayList()
        Creates a new TLongArrayList instance with the default capacity.
      • TLongArrayList

        public TLongArrayList(int capacity)
        Creates a new TLongArrayList instance with the specified capacity.
        Parameters:
        capacity - an int value
      • TLongArrayList

        public TLongArrayList(int capacity,
                              long no_entry_value)
        Creates a new TLongArrayList instance with the specified capacity.
        Parameters:
        capacity - an int value
        no_entry_value - an long value that represents null.
      • TLongArrayList

        public TLongArrayList(TLongCollection collection)
        Creates a new TLongArrayList instance that contains a copy of the collection passed to us.
        Parameters:
        collection - the collection to copy
      • TLongArrayList

        public TLongArrayList(long[] values)
        Creates a new TLongArrayList instance whose capacity is the length of values array and whose initial contents are the specified values.

        A defensive copy of the given values is held by the new instance.

        Parameters:
        values - an long[] value
      • TLongArrayList

        protected TLongArrayList(long[] values,
                                 long no_entry_value,
                                 boolean wrap)
    • Method Detail

      • wrap

        public static TLongArrayList wrap(long[] values)
        Returns a primitive List implementation that wraps around the given primitive array.

        NOTE: mutating operation are allowed as long as the List does not grow. In that case an IllegalStateException will be thrown
        Parameters:
        values -
        Returns:
      • wrap

        public static TLongArrayList wrap(long[] values,
                                          long no_entry_value)
        Returns a primitive List implementation that wraps around the given primitive array.

        NOTE: mutating operation are allowed as long as the List does not grow. In that case an IllegalStateException will be thrown
        Parameters:
        values -
        no_entry_value -
        Returns:
      • getNoEntryValue

        public long getNoEntryValue()
      • ensureCapacity

        public void ensureCapacity(int capacity)
        Grow the internal array as needed to accommodate the specified number of elements. The size of the array bytes on each resize unless capacity requires more than twice the current capacity.
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • trimToSize

        public void trimToSize()
        Sheds any excess capacity above and beyond the current size of the list.
      • add

        public boolean add(long val)
      • add

        public void add(long[] vals)
      • add

        public void add(long[] vals,
                        int offset,
                        int length)
      • insert

        public void insert(int offset,
                           long value)
      • insert

        public void insert(int offset,
                           long[] values)
      • insert

        public void insert(int offset,
                           long[] values,
                           int valOffset,
                           int len)
      • get

        public long get(int offset)
      • getQuick

        public long getQuick(int offset)
        Returns the value at the specified offset without doing any bounds checking.
      • set

        public long set(int offset,
                        long val)
      • replace

        public long replace(int offset,
                            long val)
      • set

        public void set(int offset,
                        long[] values)
      • set

        public void set(int offset,
                        long[] values,
                        int valOffset,
                        int length)
      • setQuick

        public void setQuick(int offset,
                             long val)
        Sets the value at the specified offset without doing any bounds checking.
      • clear

        public void clear()
      • clear

        public void clear(int capacity)
        Flushes the internal state of the list, setting the capacity of the empty list to capacity.
      • reset

        public void reset()
        Sets the size of the list to 0, but does not change its capacity. This method can be used as an alternative to the clear() method if you want to recycle a list without allocating new backing arrays.
      • resetQuick

        public void resetQuick()
        Sets the size of the list to 0, but does not change its capacity. This method can be used as an alternative to the clear() method if you want to recycle a list without allocating new backing arrays. This method differs from reset() in that it does not clear the old values in the backing array. Thus, it is possible for getQuick to return stale data if this method is used and the caller is careless about bounds checking.
      • remove

        public boolean remove(long value)
      • removeAt

        public long removeAt(int offset)
      • remove

        public void remove(int offset,
                           int length)
      • containsAll

        public boolean containsAll(Collection<?> collection)
      • containsAll

        public boolean containsAll(long[] array)
      • addAll

        public boolean addAll(Collection<? extends Long> collection)
      • addAll

        public boolean addAll(long[] array)
      • retainAll

        public boolean retainAll(Collection<?> collection)
      • retainAll

        public boolean retainAll(long[] array)
      • removeAll

        public boolean removeAll(Collection<?> collection)
      • removeAll

        public boolean removeAll(long[] array)
      • transformValues

        public void transformValues(TLongFunction function)
      • reverse

        public void reverse()
      • reverse

        public void reverse(int from,
                            int to)
      • shuffle

        public void shuffle(Random rand)
      • subList

        public TLongList subList(int begin,
                                 int end)
      • toArray

        public long[] toArray()
      • toArray

        public long[] toArray(int offset,
                              int len)
      • toArray

        public long[] toArray(long[] dest)
      • toArray

        public long[] toArray(long[] dest,
                              int offset,
                              int len)
      • toArray

        public long[] toArray(long[] dest,
                              int source_pos,
                              int dest_pos,
                              int len)
      • equals

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • forEachDescending

        public boolean forEachDescending(TLongProcedure procedure)
      • sort

        public void sort()
      • sort

        public void sort(int fromIndex,
                         int toIndex)
      • fill

        public void fill(long val)
      • fill

        public void fill(int fromIndex,
                         int toIndex,
                         long val)
      • binarySearch

        public int binarySearch(long value)
      • binarySearch

        public int binarySearch(long value,
                                int fromIndex,
                                int toIndex)
      • indexOf

        public int indexOf(long value)
      • indexOf

        public int indexOf(int offset,
                           long value)
      • lastIndexOf

        public int lastIndexOf(long value)
      • lastIndexOf

        public int lastIndexOf(int offset,
                               long value)
      • contains

        public boolean contains(long value)
      • max

        public long max()
      • min

        public long min()
      • sum

        public long sum()
      • toString

        public String toString()