Documentation of 'jsat.utils.LongList' Java class
LongList
jsat.utils

Class LongList

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


    public class LongList
    extends java.util.AbstractList<java.lang.Long>
    implements java.io.Serializable
    Provides a modifiable implementation of a List using an array of longs. This provides considerable memory efficency improvements over using an ArrayList to store longs. Null is not allowed into the list.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      LongList()
      Creates a new LongList
      LongList(java.util.Collection<java.lang.Long> c) 
      LongList(int capacity)
      Creates a new LongList with the given initial capacity
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(int index, long element)
      Operates exactly as add(int, java.lang.Long)
      void add(int index, java.lang.Long element) 
      boolean add(long e)
      Operates exactly as add(java.lang.Long)
      boolean add(java.lang.Long e) 
      void clear() 
      java.lang.Long get(int index) 
      long getL(int index)
      Operates exactly as get(int)
      java.lang.Long remove(int index) 
      long set(int index, long element)
      Operates exactly as set(int, java.lang.Long)
      java.lang.Long set(int index, java.lang.Long element) 
      int size() 
      static java.util.List<java.lang.Long> view(long[] array, int length)
      Creates and returns a view of the given long array that requires only a small object allocation.
      • Methods inherited from class java.util.AbstractList

        addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
      • Methods inherited from interface java.util.Collection

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

        forEach
    • Constructor Detail

      • LongList

        public LongList()
        Creates a new LongList
      • LongList

        public LongList(int capacity)
        Creates a new LongList with the given initial capacity
        Parameters:
        capacity - the starting internal storage space size
      • LongList

        public LongList(java.util.Collection<java.lang.Long> c)
    • Method Detail

      • 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>
        Overrides:
        clear in class java.util.AbstractList<java.lang.Long>
      • set

        public long set(int index,
                        long element)
        Operates exactly as set(int, java.lang.Long)
        Parameters:
        index - the index to set
        element - the value to set
        Returns:
        the previous value at the index
      • set

        public java.lang.Long set(int index,
                                  java.lang.Long element)
        Specified by:
        set in interface java.util.List<java.lang.Long>
        Overrides:
        set in class java.util.AbstractList<java.lang.Long>
      • add

        public void add(int index,
                        long element)
        Operates exactly as add(int, java.lang.Long)
        Parameters:
        index - the index to add the value into
        element - the value to add
      • add

        public void add(int index,
                        java.lang.Long element)
        Specified by:
        add in interface java.util.List<java.lang.Long>
        Overrides:
        add in class java.util.AbstractList<java.lang.Long>
      • add

        public boolean add(long e)
        Operates exactly as add(java.lang.Long)
        Parameters:
        e - the value to add
        Returns:
        true if it was added, false otherwise
      • add

        public boolean add(java.lang.Long e)
        Specified by:
        add in interface java.util.Collection<java.lang.Long>
        Specified by:
        add in interface java.util.List<java.lang.Long>
        Overrides:
        add in class java.util.AbstractList<java.lang.Long>
      • getL

        public long getL(int index)
        Operates exactly as get(int)
        Parameters:
        index - the index of the value to get
        Returns:
        the value at the index
      • get

        public java.lang.Long get(int index)
        Specified by:
        get in interface java.util.List<java.lang.Long>
        Specified by:
        get in class java.util.AbstractList<java.lang.Long>
      • 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>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.Long>
      • remove

        public java.lang.Long remove(int index)
        Specified by:
        remove in interface java.util.List<java.lang.Long>
        Overrides:
        remove in class java.util.AbstractList<java.lang.Long>
      • view

        public static java.util.List<java.lang.Long> view(long[] array,
                                                          int length)
        Creates and returns a view of the given long array that requires only a small object allocation.
        Parameters:
        array - the array to wrap into a list
        length - the number of values of the array to use, starting from zero
        Returns:
        a list view of the array

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.