public class WrapperList<E>
extends java.lang.Object
implements java.util.List<E>, java.lang.Iterable<E>
Vector
instance.Collections
,
List
Constructor and Description |
---|
WrapperList()
Constructor.
|
WrapperList(int initialCapacity)
Constructor.
|
WrapperList(java.util.List<E> delegate)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element)
Adds a element at the end of the list.
|
void |
add(int index,
E element)
Inserts the specified element at the specified position in this list.
|
boolean |
addAll(java.util.Collection<? extends E> elements)
Appends all of the elements in the specified collection to the end of
this list.
|
boolean |
addAll(int index,
java.util.Collection<? extends E> elements)
Inserts all of the elements in the specified collection into this list at
the specified position.
|
void |
clear()
Removes all of the elements from this list.
|
boolean |
contains(java.lang.Object element)
Returns true if this list contains the specified element.
|
boolean |
containsAll(java.util.Collection<?> elements)
Returns true if this list contains all of the elements of the specified
collection.
|
boolean |
equals(java.lang.Object o)
Compares the specified object with this list for equality.
|
E |
get(int index)
Returns the element at the specified position in this list.
|
protected java.util.List<E> |
getDelegate()
Returns the delegate list.
|
int |
hashCode()
Returns the hash code value for this list.
|
int |
indexOf(java.lang.Object element)
Returns the index in this list of the first occurrence of the specified
element, or -1 if this list does not contain this element.
|
boolean |
isEmpty()
Returns true if this list contains no elements.
|
java.util.Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
int |
lastIndexOf(java.lang.Object element)
Returns the index in this list of the last occurrence of the specified
element, or -1 if this list does not contain this element.
|
java.util.ListIterator<E> |
listIterator()
Returns a list iterator of the elements in this list (in proper
sequence).
|
java.util.ListIterator<E> |
listIterator(int index)
Returns a list iterator of the elements in this list (in proper
sequence), starting at the specified position in this list.
|
E |
remove(int index)
Removes the element at the specified position in this list.
|
boolean |
remove(java.lang.Object element)
Removes the first occurrence in this list of the specified element.
|
boolean |
removeAll(java.util.Collection<?> elements)
Removes from this list all the elements that are contained in the
specified collection.
|
boolean |
retainAll(java.util.Collection<?> elements)
RemovesRetains only the elements in this list that are contained in the
specified collection.
|
E |
set(int index,
E element)
Replaces the element at the specified position in this list with the
specified element.
|
int |
size()
Returns the number of elements in this list.
|
java.util.List<E> |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this list in proper
sequence.
|
<T> T[] |
toArray(T[] a)
Returns an array containing all of the elements in this list in proper
sequence; the runtime type of the returned array is that of the specified
array.
|
java.lang.String |
toString()
Returns a string representation of the list.
|
public WrapperList()
public WrapperList(int initialCapacity)
initialCapacity
- The initial list capacity.public WrapperList(java.util.List<E> delegate)
delegate
- The delegate list.public boolean add(E element)
public void add(int index, E element)
add
in interface java.util.List<E>
index
- The insertion position.element
- The element to insert.public boolean addAll(java.util.Collection<? extends E> elements)
public boolean addAll(int index, java.util.Collection<? extends E> elements)
addAll
in interface java.util.List<E>
index
- The insertion position.elements
- The collection of elements to insert.public void clear()
public boolean contains(java.lang.Object element)
public boolean containsAll(java.util.Collection<?> elements)
public boolean equals(java.lang.Object o)
public E get(int index)
get
in interface java.util.List<E>
index
- The element position.protected java.util.List<E> getDelegate()
public int hashCode()
public int indexOf(java.lang.Object element)
indexOf
in interface java.util.List<E>
element
- The element to find.public boolean isEmpty()
public java.util.Iterator<E> iterator()
public int lastIndexOf(java.lang.Object element)
lastIndexOf
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
index
- The starting position.public E remove(int index)
remove
in interface java.util.List<E>
public boolean remove(java.lang.Object element)
public boolean removeAll(java.util.Collection<?> elements)
public boolean retainAll(java.util.Collection<?> elements)
public E set(int index, E element)
set
in interface java.util.List<E>
index
- The position of the element to replace.element
- The new element.public int size()
public java.util.List<E> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<E>
fromIndex
- The start position.toIndex
- The end position (exclusive).public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2024 Restlet.