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