Class ListOfLong

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

    public class ListOfLong
    extends java.util.ArrayList<java.lang.Long>
    ListOfLong : a list of long with convenient management tools and stuff for statistics as sum, squareSum. Should be more up to date than LongVector.
    Author:
    Guy Vachet
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      ListOfLong()
      constructor of an empty ListOfLong.
      ListOfLong​(int initialCapacity)
      Constructs an empty list of long with the specified initial capacity.
      ListOfLong​(ListOfLong listOfLong)
      Constructs a list of long containing the elements of the specified collection, in the order they are returned by the collection's iterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(ListOfLong listOfLong)
      adds all element
      void addLong​(long longValue)
      adds a long element
      double getSquareSum()
      gets the list squareSum
      double getSum()
      gets the list sum
      long longAt​(int index)
      long value at the specified position in this list.
      void removeLongAt​(int index)
      remove long value at the specified position in this list.
      void reset()
      resets ListOfLong
      void setSquareSum​(double squareSum)  
      void setSum​(double sum)  
      java.lang.String toString()
      toString defines the string representative of all long values.
      java.lang.String toString​(int numberOfColumn)
      toString defines the string representative of all long values as an Array of supplied number of columns.
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll
      • Methods inherited from class java.lang.Object

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

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Constructor Detail

      • ListOfLong

        public ListOfLong()
        constructor of an empty ListOfLong.
      • ListOfLong

        public ListOfLong​(int initialCapacity)
        Constructs an empty list of long with the specified initial capacity.
        Parameters:
        initialCapacity -
      • ListOfLong

        public ListOfLong​(ListOfLong listOfLong)
        Constructs a list of long containing the elements of the specified collection, in the order they are returned by the collection's iterator.
        Parameters:
        listOfLong -
    • Method Detail

      • reset

        public void reset()
        resets ListOfLong
      • addLong

        public void addLong​(long longValue)
        adds a long element
        Parameters:
        longValue - the long to addLong
      • addAll

        public void addAll​(ListOfLong listOfLong)
        adds all element
        Parameters:
        listOfLong - the ListOfLong to addLong
      • removeLongAt

        public void removeLongAt​(int index)
        remove long value at the specified position in this list.
        Parameters:
        index - the position
      • longAt

        public long longAt​(int index)
        long value at the specified position in this list.
        Parameters:
        index - the position
        Returns:
        long at this position
      • getSum

        public double getSum()
        gets the list sum
        Returns:
        double sum
      • setSum

        public void setSum​(double sum)
      • getSquareSum

        public double getSquareSum()
        gets the list squareSum
        Returns:
        double squareSum
      • setSquareSum

        public void setSquareSum​(double squareSum)
      • toString

        public java.lang.String toString​(int numberOfColumn)
        toString defines the string representative of all long values as an Array of supplied number of columns.
        Parameters:
        numberOfColumn - the number of columns to format the values.
        Returns:
        string representative of all values as an Array of "n" columns.
      • toString

        public java.lang.String toString()
        toString defines the string representative of all long values.
        Overrides:
        toString in class java.util.AbstractCollection<java.lang.Long>
        Returns:
        string representative of all values (one value per line).