#include <java_util_List.h>
Inheritance diagram for java::util::List:


Public Types | |
| enum | { xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9, xmogBuildNumber = 2047 } |
|
typedef ::xmog_java_array_template< ::java::util::List > | array1D |
|
typedef ::xmog_java_array_template< ::xmog_java_array_template< ::java::util::List > > | array2D |
Public Member Functions | |
| virtual void | add (jint index, const ::java::lang::Object &element,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Inserts the specified element at the specified position in this list (optional operation). | |
| virtual bool | add (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Appends the specified element to the end of this list (optional operation). | |
| virtual bool | addAll (jint index, const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Inserts all of the elements in the specified collection into this list at the specified position (optional operation). | |
| virtual bool | addAll (const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). | |
| virtual void | clear (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes all of the elements from this list (optional operation). | |
| virtual bool | contains (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
Returns true if this list contains the specified element. | |
| virtual bool | containsAll (const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
Returns true if this list contains all of the elements of the specified collection. | |
| virtual bool | equals (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Compares the specified object with this list for equality. | |
| virtual ::java::lang::Object | get (jint index,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the element at the specified position in this list. | |
| virtual jint | hashCode (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the hash code value for this list. | |
| virtual jint | indexOf (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. | |
| virtual bool | isEmpty (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
Returns true if this list contains no elements. | |
| virtual ::java::util::Iterator | iterator (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns an iterator over the elements in this list in proper sequence. | |
| virtual jint | lastIndexOf (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. | |
| virtual bool | remove (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes the first occurrence in this list of the specified element (optional operation). | |
| virtual ::java::lang::Object | remove (jint index,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes the element at the specified position in this list (optional operation). | |
| virtual bool | removeAll (const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes from this list all the elements that are contained in the specified collection (optional operation). | |
| virtual bool | retainAll (const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Retains only the elements in this list that are contained in the specified collection (optional operation). | |
| virtual ::java::lang::Object | set (jint index, const ::java::lang::Object &element,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Replaces the element at the specified position in this list with the specified element (optional operation). | |
| virtual jint | size (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the number of elements in this list. | |
| virtual ::java::util::List | subList (jint fromIndex, jint toIndex,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. | |
| virtual ::xmog_java_array_template< ::java::lang::Object > | toArray (const ::xmog_java_array_template< ::java::lang::Object > &a,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| 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. | |
| virtual ::xmog_java_array_template< ::java::lang::Object > | toArray (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns an array containing all of the elements in this list in proper sequence. | |
The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list.
Unlike sets, lists typically allow duplicate elements. More formally, lists typically allow pairs of elements e1 and e2 such that e1.equals(e2), and they typically allow multiple null elements if they allow null elements at all. It is not inconceivable that someone might wish to implement a list that prohibits duplicates, by throwing runtime exceptions when the user attempts to insert them, but we expect this usage to be rare.
The List interface places additional stipulations, beyond those specified in the Collection interface, on the contracts of the iterator, add, remove, equals, and hashCode methods. Declarations for other inherited methods are also included here for convenience.
The List interface provides four methods for positional (indexed) access to list elements. Lists (like Java arrays) are zero based. Note that these operations may execute in time proportional to the index value for some implementations (the LinkedList class, for example). Thus, iterating over the elements in a list is typically preferable to indexing through it if the caller does not know the implementation.
The List interface provides a special iterator, called a ListIterator, that allows element insertion and replacement, and bidirectional access in addition to the normal operations that the Iterator interface provides. A method is provided to obtain a list iterator that starts at a specified position in the list.
The List interface provides two methods to search for a specified object. From a performance standpoint, these methods should be used with caution. In many implementations they will perform costly linear searches.
The List interface provides two methods to efficiently insert and remove multiple elements at an arbitrary point in the list.
Note: While it is permissible for lists to contain themselves as elements, extreme caution is advised: the equals and hashCode methods are no longer well defined on a such a list.
Some list implementations have restrictions on the elements that they may contain. For example, some implementations prohibit null elements, and some have restrictions on the types of their elements. Attempting to add an ineligible element throws an unchecked exception, typically NullPointerException or ClassCastException. Attempting to query the presence of an ineligible element may throw an exception, or it may simply return false; some implementations will exhibit the former behavior and some will exhibit the latter. More generally, attempting an operation on an ineligible element whose completion would not result in the insertion of an ineligible element into the list may throw an exception or it may succeed, at the option of the implementation. Such exceptions are marked as "optional" in the specification for this interface.
This interface is a member of the Java Collections Framework.
|
||||||||||||||||||||
|
Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Appends the specified element to the end of this list (optional operation). Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||||||
|
Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||
|
Removes all of the elements from this list (optional operation). This list will be empty after this call returns (unless it throws an exception).
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Returns
More formally, returns
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Returns
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, and java::util::Vector. |
|
||||||||||||||||
|
Compares the specified object with this list for equality.
Returns
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Returns the element at the specified position in this list.
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||
|
Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:
hashCode = 1; Iterator i = list.iterator(); while (i.hasNext()) { Object obj = i.next(); hashCode = 31*hashCode + (obj==null ? 0 : obj.hashCode()); }
This ensures that
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
More formally, returns the lowest index
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||
|
Returns
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||
|
Returns an iterator over the elements in this list in proper sequence.
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList. |
|
||||||||||||||||
|
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
More formally, returns the highest index
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Removes the first occurrence in this list of the specified element (optional operation).
If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, and java::util::Vector. |
|
||||||||||||||||
|
Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||
|
Removes from this list all the elements that are contained in the specified collection (optional operation).
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, and java::util::Vector. |
|
||||||||||||||||
|
Retains only the elements in this list that are contained in the specified collection (optional operation). In other words, removes from this list all the elements that are not contained in the specified collection.
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, and java::util::Vector. |
|
||||||||||||||||||||
|
Replaces the element at the specified position in this list with the specified element (optional operation).
Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||
|
Returns the number of elements in this list.
If this list contains more than
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||||||||||
|
Returns a view of the portion of this list between the specified
(If This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
list.subList(from, to).clear();
Similar idioms may be constructed for The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)
Reimplemented in java::util::AbstractList, and java::util::Vector. |
|
||||||||||||||||
|
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.
Obeys the general contract of the
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
|
||||||||||||
|
Returns an array containing all of the elements in this list in proper sequence.
Obeys the general contract of the
Reimplemented from java::util::Collection. Reimplemented in java::util::AbstractList, java::util::ArrayList, and java::util::Vector. |
1.4.1