|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.karaf.util.collections.CopyOnWriteArrayIdentityList<E>
E - the element typepublic class CopyOnWriteArrayIdentityList<E>
Implements a ArrayList variant that is thread-safe. All
write operation result in a new copy of the underlying data being created.
Iterators reflect the state of the CopyOnWriteArrayIdentityList at the time they were
created. They are not updated to reflect subsequent changes to the list. In
addition, these iterators cannot be used for modifying the underlying
CopyOnWriteArrayIdentityList.
In addition, elements are compared based on reference equality instead of
object equality when comparing values.
| Constructor Summary | |
|---|---|
CopyOnWriteArrayIdentityList()
Creates a new, empty instance of CopyOnWriteArrayList. |
|
CopyOnWriteArrayIdentityList(Collection<? extends E> c)
Creates a new instance of CopyOnWriteArrayList and fills it with the contents of a given Collection. |
|
CopyOnWriteArrayIdentityList(E[] array)
Creates a new instance of CopyOnWriteArrayList and fills it with the contents of a given array. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E e)
|
|
void |
add(int index,
E e)
|
|
boolean |
addAll(Collection<? extends E> c)
|
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
|
int |
addAllAbsent(Collection<? extends E> c)
Adds to this CopyOnWriteArrayList all those elements from a given collection that are not yet part of the list. |
|
boolean |
addIfAbsent(E e)
Adds to this CopyOnWriteArrayList another element, given that this element is not yet part of the list. |
|
void |
clear()
|
|
Object |
clone()
|
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
boolean |
equals(Object o)
|
|
E |
get(int index)
|
|
int |
hashCode()
|
|
int |
indexOf(E e,
int index)
Returns the index of a given element, starting the search from a given position in the list. |
|
int |
indexOf(Object o)
|
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
int |
lastIndexOf(E e,
int index)
Returns the last index of a given element, starting the search from a given position in the list and going backwards. |
|
int |
lastIndexOf(Object o)
|
|
ListIterator<E> |
listIterator()
|
|
ListIterator<E> |
listIterator(int index)
|
|
E |
remove(int index)
|
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(Collection<?> c)
|
|
boolean |
retainAll(Collection<?> c)
|
|
E |
set(int index,
E e)
|
|
int |
size()
|
|
List<E> |
subList(int fromIndex,
int toIndex)
|
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CopyOnWriteArrayIdentityList()
public CopyOnWriteArrayIdentityList(Collection<? extends E> c)
c - the collection the elements of which are to be copied into
the new instance.public CopyOnWriteArrayIdentityList(E[] array)
array - the array the elements of which are to be copied into the
new instance.| Method Detail |
|---|
public boolean add(E e)
add in interface Collection<E>add in interface List<E>
public void add(int index,
E e)
add in interface List<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>
public boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>public int addAllAbsent(Collection<? extends E> c)
c - the collection from which the potential new elements are
taken.
public boolean addIfAbsent(E e)
e - the potential new element.
public void clear()
clear in interface Collection<E>clear in interface List<E>public Object clone()
clone in class Objectpublic boolean contains(Object o)
contains in interface Collection<E>contains in interface List<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface List<E>public boolean equals(Object o)
equals in interface Collection<E>equals in interface List<E>equals in class Objectpublic E get(int index)
get in interface List<E>public int hashCode()
hashCode in interface Collection<E>hashCode in interface List<E>hashCode in class Object
public int indexOf(E e,
int index)
e - the element to search.index - the index at which to start the search.
public int indexOf(Object o)
indexOf in interface List<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>
public int lastIndexOf(E e,
int index)
e - the element to search.index - the index at which to start the search.
public int lastIndexOf(Object o)
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>public E remove(int index)
remove in interface List<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface List<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface List<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface List<E>
public E set(int index,
E e)
set in interface List<E>public int size()
size in interface Collection<E>size in interface List<E>
public List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface List<E>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||