|
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.SynchronizedShortCollection
This class represents synchronized collections of short values. As in the Java Collections API iterations over the collection must be synchronized on the collection itself.
Collections.synchronizedCollection(java.util.Collection)
Field Summary | |
protected ShortCollection |
collection
The collection underlying this synchronized collection. |
protected Object |
m
An object on which to synchronize this collection's methods. |
Constructor Summary | |
SynchronizedShortCollection(ShortCollection c)
Creates a new synchronized collection on an existing collection. |
Method Summary | |
boolean |
add(short v)
Adds an element to this collection. |
boolean |
addAll(ShortCollection c)
Adds all the elements of a specified collection to this collection. |
void |
clear()
Clears this collection. |
boolean |
contains(short v)
Indicates whether this collection contains a specified element. |
boolean |
containsAll(ShortCollection c)
Indicates whether all elements of a specified collection is contained in this collection. |
boolean |
equals(Object obj)
Indicates whether this collection is equal to some object. |
int |
hashCode()
Returns a hash code value for this collection. |
boolean |
isEmpty()
Indicates whether this collection is empty. |
ShortIterator |
iterator()
Returns an iterator over this collection. |
boolean |
remove(short v)
Removes a specified element from this collection. |
boolean |
removeAll(ShortCollection c)
Removes all the elements of a specified collection from this collection. |
boolean |
retainAll(ShortCollection c)
Retains only the elements of a specified collection in this collection. |
int |
size()
Returns the number of elements in this collection. |
short[] |
toArray()
Returns the elements of this collection as an array. |
short[] |
toArray(short[] a)
Returns the elements of this collection as an array. |
void |
trimToSize()
Minimizes the memory used by this collection. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ShortCollection collection
protected Object m
Constructor Detail |
public SynchronizedShortCollection(ShortCollection c)
c
- the existing collection to make synchronized.
NullPointerException
- if c is null.Method Detail |
public boolean add(short v)
ShortCollection
add
in interface ShortCollection
v
- the element to add to this collection.
ShortCollection.addAll(ShortCollection)
public boolean addAll(ShortCollection c)
ShortCollection
addAll
in interface ShortCollection
c
- the collection whose elements to add to this
collection.
ShortCollection.add(short)
public void clear()
ShortCollection
clear
in interface ShortCollection
public boolean contains(short v)
ShortCollection
contains
in interface ShortCollection
v
- the element to test for containment.
ShortCollection.containsAll(ShortCollection)
public boolean containsAll(ShortCollection c)
ShortCollection
containsAll
in interface ShortCollection
c
- the collection whose elements to test for
containment.
ShortCollection.contains(short)
public boolean equals(Object obj)
ShortCollection
equals
in interface ShortCollection
public int hashCode()
ShortCollection
hashCode
in interface ShortCollection
public boolean isEmpty()
ShortCollection
isEmpty
in interface ShortCollection
public ShortIterator iterator()
ShortCollection
iterator
in interface ShortCollection
public boolean remove(short v)
ShortCollection
remove
in interface ShortCollection
v
- the short value to remove from this collection.
public boolean removeAll(ShortCollection c)
ShortCollection
removeAll
in interface ShortCollection
c
- the collection whose elements to remove from this
collection.
public boolean retainAll(ShortCollection c)
ShortCollection
retainAll
in interface ShortCollection
c
- the collection whose elements to retain in this
collection.
public int size()
ShortCollection
size
in interface ShortCollection
public short[] toArray()
ShortCollection
toArray
in interface ShortCollection
public short[] toArray(short[] a)
ShortCollection
toArray
in interface ShortCollection
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()
ShortCollection
trimToSize
in interface ShortCollection
|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |