|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.nuiton.util.BoundedList<E>
public class BoundedList<E>
ArrayList with minimum and maximum sizes. For each operation, the size is checked and the BoundedList to ensure that it is kept in the range.
Created: 10 juin 2005
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.util.ArrayList |
|---|
clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, retainAll, subList |
| Constructor Detail |
|---|
public BoundedList(int initialCapacity)
initialCapacity - public BoundedList()
public BoundedList(Collection<E> arg0)
arg0 -
public BoundedList(int minSize,
int maxSize)
minSize - maxSize - | Method Detail |
|---|
public boolean isFull()
public boolean isToMinimum()
public boolean add(E o)
add in interface Collection<E>add in interface List<E>add in class ArrayList<E>o - the Object to be added
public void add(int index,
E o)
add in interface List<E>add in class ArrayList<E>index - the position where to add the Objecto - the Object to be addedpublic boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>addAll in class ArrayList<E>c - the collection of Objects to be added
public boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>addAll in class ArrayList<E>index - the index where to start adding the collection of objectsc - the collection of Objects to be addedpublic Object clone()
clone in class ArrayList<E>public E remove(int index)
remove in interface List<E>remove in class ArrayList<E>index - the position of the element to be removed
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)
remove in interface Collection<E>remove in interface List<E>remove in class ArrayList<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface List<E>removeAll in class AbstractCollection<E>public String toString()
toString in class AbstractCollection<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||