|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bak.pcj.AbstractBooleanCollection
This class represents an abstract base for implementing collections of boolean 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 |
AbstractBooleanCollection()
Default constructor to be invoked by sub-classes. |
Method Summary | |
boolean |
add(boolean v)
Throws UnsupportedOperationException. |
boolean |
addAll(BooleanCollection c)
Adds all the elements of a specified collection to this collection. |
void |
clear()
Clears this collection. |
boolean |
contains(boolean v)
Indicates whether this collection contains a specified element. |
boolean |
containsAll(BooleanCollection c)
Indicates whether all elements of a specified collection is contained in this collection. |
boolean |
isEmpty()
Indicates whether this collection is empty. |
boolean |
remove(boolean v)
Removes a specified element from this collection. |
boolean |
removeAll(BooleanCollection c)
Removes all the elements of a specified collection from this collection. |
boolean |
retainAll(BooleanCollection c)
Retains only the elements of a specified collection in this collection. |
int |
size()
Returns the number of elements in this collection. |
boolean[] |
toArray()
Returns the elements of this collection as an array. |
boolean[] |
toArray(boolean[] 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.BooleanCollection |
equals, hashCode, iterator |
Constructor Detail |
protected AbstractBooleanCollection()
Method Detail |
public boolean add(boolean v)
add
in interface BooleanCollection
v
- the element to add to this collection.
UnsupportedOperationException
- unconditionally.BooleanCollection.addAll(BooleanCollection)
public boolean addAll(BooleanCollection c)
BooleanCollection
addAll
in interface BooleanCollection
c
- the collection whose elements to add to this
collection.
BooleanCollection.add(boolean)
public void clear()
BooleanCollection
clear
in interface BooleanCollection
public boolean contains(boolean v)
BooleanCollection
contains
in interface BooleanCollection
v
- the element to test for containment.
BooleanCollection.containsAll(BooleanCollection)
public boolean containsAll(BooleanCollection c)
BooleanCollection
containsAll
in interface BooleanCollection
c
- the collection whose elements to test for
containment.
BooleanCollection.contains(boolean)
public boolean isEmpty()
BooleanCollection
isEmpty
in interface BooleanCollection
public boolean remove(boolean v)
BooleanCollection
remove
in interface BooleanCollection
v
- the boolean value to remove from this collection.
public boolean removeAll(BooleanCollection c)
BooleanCollection
removeAll
in interface BooleanCollection
c
- the collection whose elements to remove from this
collection.
public boolean retainAll(BooleanCollection c)
BooleanCollection
retainAll
in interface BooleanCollection
c
- the collection whose elements to retain in this
collection.
public int size()
BooleanCollection
size
in interface BooleanCollection
public boolean[] toArray()
BooleanCollection
toArray
in interface BooleanCollection
public boolean[] toArray(boolean[] a)
BooleanCollection
toArray
in interface BooleanCollection
a
- 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 BooleanCollection
public String toString()
|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |