Class PSquarePercentile.FixedCapacityList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<E>
-
- org.apache.commons.math3.stat.descriptive.rank.PSquarePercentile.FixedCapacityList<E>
-
- Type Parameters:
E-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
- Enclosing class:
- PSquarePercentile
private static class PSquarePercentile.FixedCapacityList<E> extends java.util.ArrayList<E> implements java.io.SerializableA simple fixed capacity list that has an upper bound to growth. Once its capacity is reached,addis a no-op, returningfalse.
-
-
Field Summary
Fields Modifier and Type Field Description private intcapacityCapacity of the listprivate static longserialVersionUIDSerialization Version Id
-
Constructor Summary
Constructors Constructor Description FixedCapacityList(int fixedCapacity)This constructor constructs the list with given capacity and as well as stores the capacity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)In addition it checks if theArrayList.size()returns a size that is within capacity and if true it adds; otherwise the list contents are unchanged andfalseis returned.booleanaddAll(java.util.Collection<? extends E> collection)In addition it checks if the sum of Collection size and this instance'sArrayList.size()returns a value that is within capacity and if true it adds the collection; otherwise the list contents are unchanged andfalseis returned.-
Methods inherited from class java.util.ArrayList
add, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serialization Version Id- See Also:
- Constant Field Values
-
capacity
private final int capacity
Capacity of the list
-
-
Method Detail
-
add
public boolean add(E e)
In addition it checks if theArrayList.size()returns a size that is within capacity and if true it adds; otherwise the list contents are unchanged andfalseis returned.
-
addAll
public boolean addAll(java.util.Collection<? extends E> collection)
In addition it checks if the sum of Collection size and this instance'sArrayList.size()returns a value that is within capacity and if true it adds the collection; otherwise the list contents are unchanged andfalseis returned.
-
-