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