|
PCJ API Version 1.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbak.pcj.AbstractIntCollection
This class represents an abstract base for implementing collections of int values. All operations that can be implemented using iterators are implemented as such. In most cases, this is hardly an efficient solution, and at least some of those methods should be overridden by sub-classes.
In this implementation, size() is calculated by iterating over the collection. Make sure that size() is overwritten or that iterators do not depend on the size() method.
| Constructor Summary | |
protected |
AbstractIntCollection()
Default constructor to be invoked by sub-classes. |
| Method Summary | |
boolean |
add(int v)
Throws UnsupportedOperationException. |
boolean |
addAll(IntCollection c)
Adds all the elements of a specified collection to this collection. |
void |
clear()
Clears this collection. |
boolean |
contains(int v)
Indicates whether this collection contains a specified element. |
boolean |
containsAll(IntCollection c)
Indicates whether all elements of a specified collection is contained in this collection. |
boolean |
isEmpty()
Indicates whether this collection is empty. |
boolean |
remove(int v)
Removes a specified element from this collection. |
boolean |
removeAll(IntCollection c)
Removes all the elements of a specified collection from this collection. |
boolean |
retainAll(IntCollection c)
Retains only the elements of a specified collection in this collection. |
int |
size()
Returns the number of elements in this collection. |
int[] |
toArray()
Returns the elements of this collection as an array. |
int[] |
toArray(int[] a)
Returns the elements of this collection as an array. |
String |
toString()
Returns a string representation of this collection. |
void |
trimToSize()
Does nothing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface bak.pcj.IntCollection |
equals, hashCode, iterator |
| Constructor Detail |
protected AbstractIntCollection()
| Method Detail |
public boolean add(int v)
add in interface IntCollectionv - the element to add to this collection.
UnsupportedOperationException - unconditionally.IntCollection.addAll(IntCollection)public boolean addAll(IntCollection c)
IntCollection
addAll in interface IntCollectionc - the collection whose elements to add to this
collection.
IntCollection.add(int)public void clear()
IntCollection
clear in interface IntCollectionpublic boolean contains(int v)
IntCollection
contains in interface IntCollectionv - the element to test for containment.
IntCollection.containsAll(IntCollection)public boolean containsAll(IntCollection c)
IntCollection
containsAll in interface IntCollectionc - the collection whose elements to test for
containment.
IntCollection.contains(int)public boolean isEmpty()
IntCollection
isEmpty in interface IntCollectionpublic boolean remove(int v)
IntCollection
remove in interface IntCollectionv - the int value to remove from this collection.
public boolean removeAll(IntCollection c)
IntCollection
removeAll in interface IntCollectionc - the collection whose elements to remove from this
collection.
public boolean retainAll(IntCollection c)
IntCollection
retainAll in interface IntCollectionc - the collection whose elements to retain in this
collection.
public int size()
IntCollection
size in interface IntCollectionpublic int[] toArray()
IntCollection
toArray in interface IntCollectionpublic int[] toArray(int[] a)
IntCollection
toArray in interface IntCollectiona - an array to fill with the elements of this
collection; if a is null or not
big enough to contain all the elements of this
collection, an new array is allocated,
and a is not changed.
public void trimToSize()
trimToSize in interface IntCollectionpublic String toString()
|
PCJ API Version 1.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||