|
||||||||||
| 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(java.util.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(java.util.Collection<? extends E> c)
|
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
|
|
int |
addAllAbsent(java.util.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()
|
|
java.lang.Object |
clone()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
equals(java.lang.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(java.lang.Object o)
|
|
boolean |
isEmpty()
|
|
java.util.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(java.lang.Object o)
|
|
java.util.ListIterator<E> |
listIterator()
|
|
java.util.ListIterator<E> |
listIterator(int index)
|
|
E |
remove(int index)
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
E |
set(int index,
E e)
|
|
int |
size()
|
|
java.util.List<E> |
subList(int fromIndex,
int toIndex)
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CopyOnWriteArrayIdentityList()
public CopyOnWriteArrayIdentityList(java.util.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 java.util.Collection<E>add in interface java.util.List<E>
public void add(int index,
E e)
add in interface java.util.List<E>public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>
public boolean addAll(int index,
java.util.Collection<? extends E> c)
addAll in interface java.util.List<E>public int addAllAbsent(java.util.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 java.util.Collection<E>clear in interface java.util.List<E>public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>contains in interface java.util.List<E>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>containsAll in interface java.util.List<E>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<E>equals in interface java.util.List<E>equals in class java.lang.Objectpublic E get(int index)
get in interface java.util.List<E>public int hashCode()
hashCode in interface java.util.Collection<E>hashCode in interface java.util.List<E>hashCode in class java.lang.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(java.lang.Object o)
indexOf in interface java.util.List<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>isEmpty in interface java.util.List<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.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(java.lang.Object o)
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>public E remove(int index)
remove in interface java.util.List<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>
public E set(int index,
E e)
set in interface java.util.List<E>public int size()
size in interface java.util.Collection<E>size in interface java.util.List<E>
public java.util.List<E> subList(int fromIndex,
int toIndex)
subList in interface java.util.List<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>toArray in interface java.util.List<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>toArray in interface java.util.List<E>public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||