|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList oracle.javatools.buffer.SafeArrayList
public final class SafeArrayList
The SafeArrayList
is an array List
implementation that provides basic thread-safety by implementing
a copy-on-write scheme. Because of this, fetching an
Iterator
or ListIterator
would
return a snapshot of the list data at the time the iterators
were fetched.
Although this class is declared public, it is part of the implementation, and not part of the published API.
Nested Class Summary | |
---|---|
protected static class |
SafeArrayList.SafeListIterator
A list iterator implementation based on a static array. |
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
SafeArrayList()
Construct an empty list. |
|
SafeArrayList(java.util.Collection c)
Construct a list containing the elements of the specified collection in the order that they are returned by the collections iterator. |
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object element)
Inserts the given element at the given position in this list, shifting any element down. |
boolean |
add(java.lang.Object element)
Adds (append) the given element to the end of our list. |
boolean |
addAll(java.util.Collection c)
Adds (appends) all of the elements in the given collection to the end of this list. |
boolean |
addAll(int index,
java.util.Collection c)
Inserts all of the elements of the given collection to this list at the specified index. |
void |
clear()
Empties this list. |
java.lang.Object |
clone()
Returns a shallow copy of this list instance. |
boolean |
contains(java.lang.Object element)
Fetch whether the given object is contained in this list. |
java.lang.Object |
get(int index)
Fetch the element at the specified position in this list |
int |
indexOf(java.lang.Object element)
Search for the first occurrence of the given argument, testing for equality using the equals() method. |
boolean |
isEmpty()
Tests if this list is empty. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this list in proper sequence. |
int |
lastIndexOf(java.lang.Object element)
Search for the last occurrence of the given argument in the list. |
java.util.ListIterator |
listIterator()
Returns a list iterator of the elements in this list in proper sequnce. |
java.util.ListIterator |
listIterator(int index)
Returns a list iterator of the elements in this list in proper sequence, starting at the given index. |
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list. |
boolean |
remove(java.lang.Object element)
Removes a single instance of the specified element from this collection. |
boolean |
removeAll(java.util.Collection c)
This operation is not supported by this list implementation. |
protected void |
removeRange(int startIndex,
int endIndex)
Removes from this list all of the elements between the given indexes. |
boolean |
retainAll(java.util.Collection c)
This operation is not supported by this list implementation. |
java.lang.Object |
set(int index,
java.lang.Object element)
Replace the element at the specified position in this list with the specified element |
int |
size()
Fetch the number of elements in this list. |
java.util.List |
subList(int startIndex,
int endIndex)
This operation is not supported by this list implementation. |
java.lang.Object[] |
toArray()
Return an array containing all of the elements in the list in the same order. |
java.lang.Object[] |
toArray(java.lang.Object[] array)
Return an array containing all of the elements in this list in the same order. |
java.lang.String |
toString()
Fetch a visible representation of this object. |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll |
Constructor Detail |
---|
public SafeArrayList()
public SafeArrayList(java.util.Collection c)
Method Detail |
---|
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
size
in class java.util.AbstractCollection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
isEmpty
in class java.util.AbstractCollection
public boolean contains(java.lang.Object element)
contains
in interface java.util.Collection
contains
in interface java.util.List
contains
in class java.util.AbstractCollection
element
- the element to check
public int indexOf(java.lang.Object element)
equals()
method.
indexOf
in interface java.util.List
indexOf
in class java.util.AbstractList
element
- the element to check
public int lastIndexOf(java.lang.Object element)
lastIndexOf
in interface java.util.List
lastIndexOf
in class java.util.AbstractList
element
- the element to check
public java.lang.Object clone()
clone
in class java.lang.Object
SafeArrayList
instancepublic java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in class java.util.AbstractCollection
public java.lang.Object[] toArray(java.lang.Object[] array)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
toArray
in class java.util.AbstractCollection
array
- the array into which to store the elements of the
list (if it is big enough)
public java.lang.Object get(int index)
get
in interface java.util.List
get
in class java.util.AbstractList
index
- the index of the element to return
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.AbstractList
index
- the index of the element to replaceelement
- the replacement element
public boolean add(java.lang.Object element)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.AbstractList
element
- the element to add
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.AbstractList
index
- the index at which to insert the elementelement
- the element to insertpublic boolean remove(java.lang.Object element)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.AbstractCollection
element
- the element to be removed
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.AbstractList
index
- the index of the element to remove
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.AbstractList
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.AbstractCollection
c
- the elements to be appended to this list
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.AbstractList
index
- the location in which to insert the new elementsc
- the collection to add to our list
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.AbstractCollection
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.AbstractCollection
protected void removeRange(int startIndex, int endIndex)
removeRange
in class java.util.AbstractList
startIndex
- the index to start the removal from (inclusive)endIndex
- the index to end the removal at (exclusive)public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
iterator
in class java.util.AbstractList
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
listIterator
in class java.util.AbstractList
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
listIterator
in class java.util.AbstractList
index
- the index to start from
public java.util.List subList(int startIndex, int endIndex)
subList
in interface java.util.List
subList
in class java.util.AbstractList
public java.lang.String toString()
toString
in class java.util.AbstractCollection
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |