|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.adfnmc.java.util.AbstractCollection
oracle.adfnmc.java.util.AbstractList
public abstract class AbstractList
AbstractList is an abstract implementation of the List interface, optimized for a backing store which supports random access. This implementation does not support adding or replacing. A subclass must implement the abstract methods get() and size().
Field Summary | |
---|---|
protected int |
modCount
|
Constructor Summary | |
---|---|
protected |
AbstractList()
Constructs a new instance of this AbstractList. |
Method Summary | |
---|---|
void |
add(int location,
java.lang.Object object)
Inserts the specified object into this List at the specified location. |
boolean |
add(java.lang.Object object)
Adds the specified object at the end of this List. |
boolean |
addAll(int location,
Collection collection)
Inserts the objects in the specified Collection at the specified location in this List. |
void |
clear()
Removes all elements from this List, leaving it empty. |
boolean |
equals(java.lang.Object object)
Compares the specified object to this List and answer if they are equal. |
abstract java.lang.Object |
get(int location)
Answers the element at the specified location in this List. |
int |
hashCode()
Answers an integer hash code for the receiver. |
int |
indexOf(java.lang.Object object)
Searches this List for the specified object and returns the index of the first occurrence. |
Iterator |
iterator()
Answers an Iterator on the elements of this List. |
int |
lastIndexOf(java.lang.Object object)
Searches this List for the specified object and returns the index of the last occurrence. |
ListIterator |
listIterator()
Answers a ListIterator on the elements of this List. |
ListIterator |
listIterator(int location)
Answers a ListIterator on the elements of this List. |
java.lang.Object |
remove(int location)
Removes the object at the specified location from this List. |
protected void |
removeRange(int start,
int end)
Removes the objects in the specified range from the start to the, but not including, end index. |
java.lang.Object |
set(int location,
java.lang.Object object)
Replaces the element at the specified location in this List with the specified object. |
List |
subList(int start,
int end)
Returns a part of consecutive elements of this list as a view. |
Methods inherited from class oracle.adfnmc.java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.adfnmc.java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray |
Methods inherited from interface oracle.adfnmc.java.util.Collection |
---|
toArray |
Field Detail |
---|
protected transient int modCount
Constructor Detail |
---|
protected AbstractList()
Method Detail |
---|
public void add(int location, java.lang.Object object)
add
in interface List
location
- the index at which to insertobject
- the object to add
java.lang.UnsupportedOperationException
- when adding to this List is not supported
java.lang.ClassCastException
- when the class of the object is inappropriate for this List
java.lang.IllegalArgumentException
- when the object cannot be added to this List
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public boolean add(java.lang.Object object)
add
in interface Collection
add
in interface List
add
in class AbstractCollection
object
- the object to add
java.lang.UnsupportedOperationException
- when adding to this List is not supported
java.lang.ClassCastException
- when the class of the object is inappropriate for this List
java.lang.IllegalArgumentException
- when the object cannot be added to this Listpublic boolean addAll(int location, Collection collection)
addAll
in interface List
location
- the index at which to insertcollection
- the Collection of objects
java.lang.UnsupportedOperationException
- when adding to this List is not supported
java.lang.ClassCastException
- when the class of an object is inappropriate for this List
java.lang.IllegalArgumentException
- when an object cannot be added to this List
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public void clear()
clear
in interface Collection
clear
in interface List
clear
in class AbstractCollection
java.lang.UnsupportedOperationException
- when removing from this List is not supportedList.isEmpty()
,
List.size()
public boolean equals(java.lang.Object object)
equals
in interface Collection
equals
in interface List
equals
in class java.lang.Object
object
- the object to compare with this object
hashCode()
public abstract java.lang.Object get(int location)
get
in interface List
location
- the index of the element to return
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
public int hashCode()
hashCode
in interface Collection
hashCode
in interface List
hashCode
in class java.lang.Object
equals(java.lang.Object)
public int indexOf(java.lang.Object object)
indexOf
in interface List
object
- the object to search for
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface List
iterator
in class AbstractCollection
Iterator
public int lastIndexOf(java.lang.Object object)
lastIndexOf
in interface List
object
- the object to search for
public ListIterator listIterator()
listIterator
in interface List
ListIterator
public ListIterator listIterator(int location)
listIterator
in interface List
location
- the index at which to start the iteration
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
ListIterator
public java.lang.Object remove(int location)
remove
in interface List
location
- the index of the object to remove
java.lang.UnsupportedOperationException
- when removing from this List is not supported
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
protected void removeRange(int start, int end)
start
- the index at which to start removingend
- the index one past the end of the range to remove
java.lang.UnsupportedOperationException
- when removing from this List is not supported
java.lang.IndexOutOfBoundsException
- when start < 0
set
public java.lang.Object set(int location,
java.lang.Object object)
- Replaces the element at the specified location in this List with the specified object.
- Specified by:
set
in interface List
- Parameters:
location
- the index at which to put the specified objectobject
- the object to add
- Returns:
- the previous element at the index
- Throws:
java.lang.UnsupportedOperationException
- when replacing elements in this List is not supported
java.lang.ClassCastException
- when the class of an object is inappropriate for this List
java.lang.IllegalArgumentException
- when an object cannot be added to this List
java.lang.IndexOutOfBoundsException
- when location < 0 || >= size()
subList
public List subList(int start,
int end)
- Returns a part of consecutive elements of this list as a view. From start (inclusive), to end(exclusive). The
returned view will be of zero length if start equals end. Any change occurs in the returned subList will be
reflected to the original list, and vice-versa. All the supported optional operations by the original list will
also be supported by this subList.
This method can be used as a handy method to do some operations on a sub range of the original list. For example:
list.subList(from, to).clear();
If the original list is modified other than through the returned subList, the behavior of the returned subList
becomes undefined.
The returned subList is a subclass of AbstractList. The subclass stores offset, size of itself, and modCount of the
original list. If the original list implements RandomAccess interface, the returned subList also implements
RandomAccess interface.
The subList's set(int, Object), get(int), add(int, Object), remove(int), addAll(int, Collection) and
removeRange(int, int) methods first check the bounds, adjust offsets and then call the corresponding methods of the
original AbstractList. addAll(Collection c) method of the returned subList calls the original addAll(offset + size,
c).
The listIterator(int) method of the subList wraps the original list iterator. The iterator() method of the subList
invokes the original listIterator() method, and the size() method merely returns the size of the subList.
All methods will throw a ConcurrentModificationException if the modCount of the original list is not equal to the
expected value.
- Specified by:
subList
in interface List
- Parameters:
start
- start index of the subList, include startend
- end index of the subList, exclude end
- Returns:
- a subList view of this list start from start (inclusive), end with end (exclusive)
- Throws:
java.lang.IndexOutOfBoundsException
- when (start < 0 || end > size())
java.lang.IllegalArgumentException
- when (start > end)
Overview
Package
Class
Tree
Deprecated
Index
Help
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)
E17503-02
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.