public class BoundedList<E> extends ArrayList<E>
modCount
Constructor and Description |
---|
BoundedList()
Creates a new BoundedList with the default capacity.
|
BoundedList(Collection<E> arg0)
Creates a new BoundedList with the specified collection of elements.
|
BoundedList(int initialCapacity)
Creates a new BoundedList with the specified initialCapacity.
|
BoundedList(int minSize,
int maxSize)
Creates a new empty BoundedList with the specified min and max sizes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o)
Appends the specified element to the end of this list.
|
void |
add(int index,
E o)
Inserts the specified element at the specified position in this list.
|
boolean |
addAll(Collection<? extends E> c)
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.
|
boolean |
addAll(int index,
Collection<? extends E> c)
Inserts all of the elements in the specified Collection into this list, starting at the specified position.
|
Object |
clone()
Returns a shallow copy of this BoundedList instance
|
boolean |
isFull()
Indicates if the list size is at the maximum
|
boolean |
isToMinimum()
Indicates if the list size is to the minimum
|
E |
remove(int index)
Removes the element at the specified position in this list.
|
boolean |
remove(Object o)
Removes a single instance of the specified element from this list, if it is present (optional operation).
|
boolean |
removeAll(Collection<?> c)
Removes from this collection all of its elements that are contained in the specified collection (optional operation).
|
protected void |
removeRange(int fromIndex,
int toIndex)
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
|
String |
toString() |
clear, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public BoundedList(int initialCapacity)
initialCapacity
- FIXMEpublic BoundedList()
public BoundedList(Collection<E> arg0)
arg0
- FIXMEpublic BoundedList(int minSize, int maxSize)
minSize
- FIXMEmaxSize
- FIXMEpublic boolean isFull()
public boolean isToMinimum()
public boolean add(E o)
public void add(int index, E o)
public boolean addAll(Collection<? extends E> c)
public boolean addAll(int index, Collection<? extends E> c)
public Object clone()
public E remove(int index)
protected void removeRange(int fromIndex, int toIndex)
removeRange
in class ArrayList<E>
fromIndex
- index of first element to be removedtoIndex
- index after last element to be removedpublic boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public String toString()
toString
in class AbstractCollection<E>
Copyright © 2004–2020 CodeLutin. All rights reserved.