|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractSet bak.pcj.adapter.IntSetToSetAdapter
This class represents adapters of int sets to Java Collections Framework sets. The adapter is implemented as a wrapper around a primitive set. Thus, changes to the underlying set are reflected by this set and vice versa.
IntSet
,
Set
Field Summary | |
protected IntSet |
set
The underlying primitive set. |
Constructor Summary | |
IntSetToSetAdapter(IntSet set)
Creates a new adaption of a set of int values to a Java Collections Framework set. |
Method Summary | |
boolean |
add(Object o)
Adds an element to this set. |
void |
clear()
Clears this collection. |
boolean |
contains(Object o)
Indicates whether this set contains a specified element. |
int |
hashCode()
Returns a hash code value for this set. |
Iterator |
iterator()
Returns an iterator over this set. |
boolean |
remove(Object o)
Removes a specified element from this set. |
boolean |
retainAll(Collection c)
Retains only the elements of a specified collection in this set. |
int |
size()
Returns the number of elements in this set. |
Methods inherited from class java.util.AbstractSet |
equals, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, isEmpty, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, containsAll, isEmpty, toArray, toArray |
Field Detail |
protected IntSet set
Constructor Detail |
public IntSetToSetAdapter(IntSet set)
set
- the underlying primitive set.
NullPointerException
- if set is null.Method Detail |
public boolean add(Object o)
o
- the element to add to this set.
IllegalArgumentException
- if o is null.
ClassCastException
- if o is not of class Integer
.
UnsupportedOperationException
- if the operation is not supported by the
underlying set.public void clear()
UnsupportedOperationException
- if the operation is not supported by the
underlying set.public boolean contains(Object o)
Note that this set can never contain null
values or values of other classes than Integer
.
In those cases, this method will return false.
o
- the element to test for containment.
public int hashCode()
public Iterator iterator()
public boolean remove(Object o)
Note that this set can never contain null
values or values of other classes than Integer
.
In those cases, this method will return false.
o
- the Integer value to remove from this set.
UnsupportedOperationException
- if the operation is not supported by the
underlying set.public boolean retainAll(Collection c)
This method is only overridden to work
around a bug in AbstractSet
,
which does not throw a
NullPointerException
when the
argument is null and the set is empty. The
bug is inherited from java.util.AbstractCollection
.
c
- the collection whose elements to retain in this
collection.
UnsupportedOperationException
- if the operation is not supported by the underlying
set.
NullPointerException
- if c is null.public int size()
|
PCJ API Version 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |