public class WrapperList<E> extends Object implements List<E>, Iterable<E>
Vector
instance.Collections
,
List
Constructor and Description |
---|
WrapperList()
Constructor.
|
WrapperList(int initialCapacity)
Constructor.
|
WrapperList(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(Collection<? extends E> elements)
Appends all of the elements in the specified collection to the end of
this list.
|
boolean |
addAll(int index,
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(Object element)
Returns true if this list contains the specified element.
|
boolean |
containsAll(Collection<?> elements)
Returns true if this list contains all of the elements of the specified
collection.
|
boolean |
equals(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 List<E> |
getDelegate()
Returns the delegate list.
|
int |
hashCode()
Returns the hash code value for this list.
|
int |
indexOf(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.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
int |
lastIndexOf(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.
|
ListIterator<E> |
listIterator()
Returns a list iterator of the elements in this list (in proper
sequence).
|
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(Object element)
Removes the first occurrence in this list of the specified element.
|
boolean |
removeAll(Collection<?> elements)
Removes from this list all the elements that are contained in the
specified collection.
|
boolean |
retainAll(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.
|
List<E> |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
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.
|
String |
toString()
Returns a string representation of the list.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
public WrapperList()
public WrapperList(int initialCapacity)
initialCapacity
- The initial list capacity.public boolean add(E element)
public void add(int index, E element)
public boolean addAll(Collection<? extends E> elements)
public boolean addAll(int index, Collection<? extends E> elements)
public void clear()
public boolean contains(Object element)
public boolean containsAll(Collection<?> elements)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
elements
- The collection of elements to find.public boolean equals(Object o)
public E get(int index)
public int hashCode()
public int indexOf(Object element)
public boolean isEmpty()
public Iterator<E> iterator()
public int lastIndexOf(Object element)
lastIndexOf
in interface List<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
index
- The starting position.public E remove(int index)
public boolean remove(Object element)
public boolean removeAll(Collection<?> elements)
public boolean retainAll(Collection<?> elements)
public E set(int index, E element)
public int size()
public List<E> subList(int fromIndex, int toIndex)
public Object[] toArray()
public <T> T[] toArray(T[] a)
Copyright © 2005–2015. All rights reserved.