|
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.SynchronizedIntCollection
This class represents synchronized collections of int 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 IntCollection |
collection
The collection underlying this synchronized collection. |
protected Object |
m
An object on which to synchronize this collection's methods. |
Constructor Summary | |
SynchronizedIntCollection(IntCollection c)
Creates a new synchronized collection on an existing collection. |
Method Summary | |
boolean |
add(int v)
Adds an element to this collection. |
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 |
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. |
IntIterator |
iterator()
Returns an iterator over this collection. |
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. |
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 IntCollection collection
protected Object m
Constructor Detail |
public SynchronizedIntCollection(IntCollection c)
c
- the existing collection to make synchronized.
NullPointerException
- if c is null.Method Detail |
public boolean add(int v)
IntCollection
add
in interface IntCollection
v
- the element to add to this collection.
IntCollection.addAll(IntCollection)
public boolean addAll(IntCollection c)
IntCollection
addAll
in interface IntCollection
c
- the collection whose elements to add to this
collection.
IntCollection.add(int)
public void clear()
IntCollection
clear
in interface IntCollection
public boolean contains(int v)
IntCollection
contains
in interface IntCollection
v
- the element to test for containment.
IntCollection.containsAll(IntCollection)
public boolean containsAll(IntCollection c)
IntCollection
containsAll
in interface IntCollection
c
- the collection whose elements to test for
containment.
IntCollection.contains(int)
public boolean equals(Object obj)
IntCollection
equals
in interface IntCollection
public int hashCode()
IntCollection
hashCode
in interface IntCollection
public boolean isEmpty()
IntCollection
isEmpty
in interface IntCollection
public IntIterator iterator()
IntCollection
iterator
in interface IntCollection
public boolean remove(int v)
IntCollection
remove
in interface IntCollection
v
- the int value to remove from this collection.
public boolean removeAll(IntCollection c)
IntCollection
removeAll
in interface IntCollection
c
- the collection whose elements to remove from this
collection.
public boolean retainAll(IntCollection c)
IntCollection
retainAll
in interface IntCollection
c
- the collection whose elements to retain in this
collection.
public int size()
IntCollection
size
in interface IntCollection
public int[] toArray()
IntCollection
toArray
in interface IntCollection
public int[] toArray(int[] a)
IntCollection
toArray
in interface IntCollection
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()
IntCollection
trimToSize
in interface IntCollection
|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |