public interface IntCollection
Modifier and Type | Method and Description |
---|---|
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.
|
boolean add(int i)
UnsupportedOperationException
- this is an unmodifiable collectionIllegalArgumentException
- some aspect of the element prevents it
from being added to this collection.boolean addAll(IntCollection c)
NullPointerException
- c = nullUnsupportedOperationException
- this is an unmodifiable collectionIllegalArgumentException
- some aspect of an element of the specified
collection prevents it from being added to this collection.void clear()
UnsupportedOperationException
- this is an unmodifiable collectionboolean contains(int i)
boolean containsAll(IntCollection c)
NullPointerException
- c = nullboolean isEmpty()
IntIterator iterator()
boolean remove(int i)
UnsupportedOperationException
- this is an unmodifiable collectionboolean removeAll(IntCollection c)
NullPointerException
- c = nullUnsupportedOperationException
- this is an unmodifiable collectionboolean retainAll(IntCollection c)
NullPointerException
- c = nullUnsupportedOperationException
- this is an unmodifiable collectionint size()
int[] toArray()
int[] toArray(int[] array)
NullPointerException
- array = null
© Emina Torlak 2005-present