Class ListOfLong
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<java.lang.Long>
-
- org.ow2.clif.analyze.statistics.util.data.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
-
-
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 voidaddAll(ListOfLong listOfLong)adds all elementvoidaddLong(long longValue)adds a long elementdoublegetSquareSum()gets the list squareSumdoublegetSum()gets the list sumlonglongAt(int index)long value at the specified position in this list.voidremoveLongAt(int index)remove long value at the specified position in this list.voidreset()resets ListOfLongvoidsetSquareSum(double squareSum)voidsetSum(double sum)java.lang.StringtoString()toString defines the string representative of all long values.java.lang.StringtoString(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
-
-
-
-
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:
toStringin classjava.util.AbstractCollection<java.lang.Long>- Returns:
- string representative of all values (one value per line).
-
-