#include <java_util_Collection.h>
Inheritance diagram for java::util::Collection:


Public Types | |
| enum | { xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9, xmogBuildNumber = 2047 } |
|
typedef ::xmog_java_array_template< ::java::util::Collection > | array1D |
|
typedef ::xmog_java_array_template< ::xmog_java_array_template< ::java::util::Collection > > | array2D |
Public Member Functions | |
| virtual bool | add (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Ensures that this collection contains the specified element (optional operation). | |
| virtual bool | addAll (const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Adds all of the elements in the specified collection to this collection (optional operation). | |
| virtual void | clear (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes all of the elements from this collection (optional operation). | |
| virtual bool | contains (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
Returns true if this collection 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 collection contains all of the elements in 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 collection for equality. | |
| virtual jint | hashCode (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the hash code value for this collection. | |
| virtual bool | isEmpty (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
Returns true if this collection 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 collection. | |
| virtual bool | remove (const ::java::lang::Object &o,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes a single instance of the specified element from this collection, if it is present (optional operation). | |
| virtual bool | removeAll (const ::java::util::Collection &c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Removes all this collection's elements that are also 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 collection that are contained in the specified collection (optional operation). | |
| virtual jint | size (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags) |
| Returns the number of elements in this collection. | |
| 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 collection; 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 collection. | |
A collection represents a group of objects, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered. The SDK does not provide any direct implementations of this interface: it provides implementations of more specific subinterfaces like Set and List. This interface is typically used to pass collections around and manipulate them where maximum generality is desired.
Bags or multisets (unordered collections that may contain duplicate elements) should implement this interface directly.
All general-purpose Collection implementation classes (which typically implement Collection indirectly through one of its subinterfaces) should provide two "standard" constructors: a void (no arguments) constructor, which creates an empty collection, and a constructor with a single argument of type Collection, which creates a new collection with the same elements as its argument. In effect, the latter constructor allows the user to copy any collection, producing an equivalent collection of the desired implementation type. There is no way to enforce this convention (as interfaces cannot contain constructors) but all of the general-purpose Collection implementations in the Java platform libraries comply.
The "destructive" methods contained in this interface, that is, the methods that modify the collection on which they operate, are specified to throw UnsupportedOperationException if this collection does not support the operation. If this is the case, these methods may, but are not required to, throw an UnsupportedOperationException if the invocation would have no effect on the collection. For example, invoking the method on an unmodifiable collection may, but is not required to, throw the exception if the collection to be added is empty.
Some collection 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 collection 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.
|
||||||||||||||||
|
Ensures that this collection contains the specified element (optional operation).
Returns
Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add
If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.)
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||
|
Removes all of the elements from this collection (optional operation). This collection will be empty after this method returns unless it throws an exception.
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Returns
More formally, returns
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Returns
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Compares the specified object with this collection for equality.
While the
The general contract for the
Reimplemented from java::lang::Object. Reimplemented in java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||
|
Returns the hash code value for this collection.
While the
Reimplemented from java::lang::Object. Reimplemented in java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||
|
Returns
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||
|
Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee).
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::HashSet, java::util::List, and java::util::Set. |
|
||||||||||||||||
|
Removes a single instance of the specified element from this collection, if it is present (optional operation).
More formally, removes an element
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Removes all this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||
|
Returns the number of elements in this collection.
If this collection contains more than
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::HashSet, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||||||
|
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.
If this collection fits in the specified array with room to spare (i.e., the array has more elements than this collection), the element in the array immediately following the end of the collection is set to If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
Like the
Suppose
String[] x = (String[]) v.toArray(new String[0]);
Note that
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::List, java::util::Set, and java::util::Vector. |
|
||||||||||||
|
Returns an array containing all of the elements in this collection. If the collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs.
Reimplemented in java::util::AbstractCollection, java::util::AbstractList, java::util::AbstractSet, java::util::ArrayList, java::util::List, java::util::Set, and java::util::Vector. |
1.4.1