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