Class LongArrayList

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>, java.util.List<java.lang.Long>

    public class LongArrayList
    extends java.lang.Object
    implements java.util.List<java.lang.Long>
    An ArrayList for longs.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MIN_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      LongArrayList()
      Creates a new LongArrayList
      LongArrayList​(long[] arr)
      Creates a new Long ArrayList using the values in the given array
      LongArrayList​(LongArrayList list)
      Creates a new LongArrayList that is equivalent to the specified LongArrayList.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, long value)  
      void add​(int index, java.lang.Long value)  
      void add​(long value)  
      boolean add​(java.lang.Long value)  
      boolean addAll​(int index, java.util.Collection<? extends java.lang.Long> c)  
      boolean addAll​(java.util.Collection<? extends java.lang.Long> c)  
      void clear()  
      boolean contains​(java.lang.Object value)  
      boolean containsAll​(java.util.Collection<?> c)  
      java.lang.Long get​(int index)  
      long getLongValue​(int index)  
      int indexOf​(java.lang.Object value)  
      boolean isEmpty()  
      java.util.Iterator<java.lang.Long> iterator()  
      int lastIndexOf​(java.lang.Object value)  
      java.util.ListIterator<java.lang.Long> listIterator()  
      java.util.ListIterator<java.lang.Long> listIterator​(int index)  
      java.lang.Long remove​(int index)  
      boolean remove​(java.lang.Object value)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      void reverse()  
      java.lang.Long set​(int index, java.lang.Long value)  
      int size()  
      java.util.List<java.lang.Long> subList​(int startIndex, int endIndex)  
      java.lang.Long[] toArray()  
      java.lang.Long[] toArray​(java.lang.Long[] a)  
      <T> T[] toArray​(T[] a)  
      long[] toLongArray()  
      long[] toLongArray​(int start, int length)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        equals, hashCode, replaceAll, sort, spliterator
    • Constructor Detail

      • LongArrayList

        public LongArrayList()
        Creates a new LongArrayList
      • LongArrayList

        public LongArrayList​(long[] arr)
        Creates a new Long ArrayList using the values in the given array
        Parameters:
        arr - array of longs to initialize to.
      • LongArrayList

        public LongArrayList​(LongArrayList list)
        Creates a new LongArrayList that is equivalent to the specified LongArrayList. It creates a copy of the specified list.
        Parameters:
        list - the list to be copied.
    • Method Detail

      • add

        public void add​(long value)
      • add

        public boolean add​(java.lang.Long value)
        Specified by:
        add in interface java.util.Collection<java.lang.Long>
        Specified by:
        add in interface java.util.List<java.lang.Long>
        See Also:
        List.add(java.lang.Object)
      • add

        public void add​(int index,
                        java.lang.Long value)
        Specified by:
        add in interface java.util.List<java.lang.Long>
        See Also:
        List.add(int, java.lang.Object)
      • add

        public void add​(int index,
                        long value)
      • remove

        public java.lang.Long remove​(int index)
        Specified by:
        remove in interface java.util.List<java.lang.Long>
      • get

        public java.lang.Long get​(int index)
        Specified by:
        get in interface java.util.List<java.lang.Long>
        See Also:
        List.get(int)
      • getLongValue

        public long getLongValue​(int index)
      • set

        public java.lang.Long set​(int index,
                                  java.lang.Long value)
        Specified by:
        set in interface java.util.List<java.lang.Long>
        See Also:
        LongArrayList.LongArraySubList.set(int, long)
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<java.lang.Long>
        Specified by:
        clear in interface java.util.List<java.lang.Long>
        See Also:
        List.clear()
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Long>
        Specified by:
        size in interface java.util.List<java.lang.Long>
        See Also:
        List.size()
      • toArray

        public java.lang.Long[] toArray()
        Specified by:
        toArray in interface java.util.Collection<java.lang.Long>
        Specified by:
        toArray in interface java.util.List<java.lang.Long>
        See Also:
        List.toArray()
      • toLongArray

        public long[] toLongArray()
      • toLongArray

        public long[] toLongArray​(int start,
                                  int length)
      • reverse

        public void reverse()
      • remove

        public boolean remove​(java.lang.Object value)
        Specified by:
        remove in interface java.util.Collection<java.lang.Long>
        Specified by:
        remove in interface java.util.List<java.lang.Long>
      • indexOf

        public int indexOf​(java.lang.Object value)
        Specified by:
        indexOf in interface java.util.List<java.lang.Long>
      • subList

        public java.util.List<java.lang.Long> subList​(int startIndex,
                                                      int endIndex)
        Specified by:
        subList in interface java.util.List<java.lang.Long>
      • addAll

        public boolean addAll​(java.util.Collection<? extends java.lang.Long> c)
        Specified by:
        addAll in interface java.util.Collection<java.lang.Long>
        Specified by:
        addAll in interface java.util.List<java.lang.Long>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends java.lang.Long> c)
        Specified by:
        addAll in interface java.util.List<java.lang.Long>
      • contains

        public boolean contains​(java.lang.Object value)
        Specified by:
        contains in interface java.util.Collection<java.lang.Long>
        Specified by:
        contains in interface java.util.List<java.lang.Long>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<java.lang.Long>
        Specified by:
        containsAll in interface java.util.List<java.lang.Long>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<java.lang.Long>
        Specified by:
        isEmpty in interface java.util.List<java.lang.Long>
      • iterator

        public java.util.Iterator<java.lang.Long> iterator()
        Specified by:
        iterator in interface java.util.Collection<java.lang.Long>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Long>
        Specified by:
        iterator in interface java.util.List<java.lang.Long>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object value)
        Specified by:
        lastIndexOf in interface java.util.List<java.lang.Long>
      • listIterator

        public java.util.ListIterator<java.lang.Long> listIterator()
        Specified by:
        listIterator in interface java.util.List<java.lang.Long>
      • listIterator

        public java.util.ListIterator<java.lang.Long> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<java.lang.Long>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<java.lang.Long>
        Specified by:
        removeAll in interface java.util.List<java.lang.Long>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<java.lang.Long>
        Specified by:
        retainAll in interface java.util.List<java.lang.Long>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<java.lang.Long>
        Specified by:
        toArray in interface java.util.List<java.lang.Long>
      • toArray

        public java.lang.Long[] toArray​(java.lang.Long[] a)