|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IntCollection
The root interface in the int collection hierarchy. A collection represents a group of integers, known as its elements. Some collections allow duplicate elements and others do not. Some are ordered and others unordered. Some allow all integers and others only integers in a certain range.
Method Summary | |
---|---|
boolean |
add(int i)
Ensures that this collection contains the given integer, and returns true if this collection has changed as a result of the call. |
boolean |
addAll(IntCollection c)
Adds all of the elements in the specified collection to this collection. |
void |
clear()
Removes all elements from this collection. |
boolean |
contains(int i)
Returns true if i is an element in this collection. |
boolean |
containsAll(IntCollection c)
Returns true if this collection contains all of the elements in the specified collection. |
boolean |
isEmpty()
Returns true if this collection has no elements; otherwise returns false. |
IntIterator |
iterator()
Returns an iterator over the elements in this collection. |
boolean |
remove(int i)
Removes a single instance of the given integer from this collection, and returns true if this collection has changed as a result of the call. |
boolean |
removeAll(IntCollection c)
Removes all of this collection's elements that are also contained in the specified collection. |
boolean |
retainAll(IntCollection c)
Retains only the elements in this collection that are contained in the specified collection. |
int |
size()
Returns the number of elements in this collection. |
int[] |
toArray()
Returns an array containing all of the elements in this collection. |
int[] |
toArray(int[] array)
Copies the elements of this collection into the specified array, provided that it is large enough, and returns it. |
Method Detail |
---|
int size()
boolean isEmpty()
IntIterator iterator()
boolean contains(int i)
boolean add(int i)
java.lang.UnsupportedOperationException
- - this is an unmodifiable collection
java.lang.IllegalArgumentException
- - some aspect of the element prevents it
from being added to this collection.boolean remove(int i)
java.lang.UnsupportedOperationException
- - this is an unmodifiable collectionboolean containsAll(IntCollection c)
java.lang.NullPointerException
- - c = nullboolean addAll(IntCollection c)
java.lang.NullPointerException
- - c = null
java.lang.UnsupportedOperationException
- - this is an unmodifiable collection
java.lang.IllegalArgumentException
- - some aspect of an element of the specified
collection prevents it from being added to this collection.boolean removeAll(IntCollection c)
java.lang.NullPointerException
- - c = null
java.lang.UnsupportedOperationException
- - this is an unmodifiable collectionboolean retainAll(IntCollection c)
java.lang.NullPointerException
- - c = null
java.lang.UnsupportedOperationException
- - this is an unmodifiable collectionvoid clear()
java.lang.UnsupportedOperationException
- - this is an unmodifiable collectionint[] toArray()
int[] toArray(int[] array)
java.lang.NullPointerException
- - array = null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |