| |
|
| java.util.AbstractSet bak.pcj.adapter.IntSetToSetAdapter
All known Subclasses: bak.pcj.adapter.IntSortedSetToSortedSetAdapter,
IntSetToSetAdapter | public class IntSetToSetAdapter extends AbstractSet (Code) | | 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.
See Also: IntSet See Also: java.util.Set author: Søren Bak version: 1.2 20-08-2003 22:56 since: 1.0 |
Field Summary | |
protected IntSet | set The underlying primitive set. |
Constructor Summary | |
public | IntSetToSetAdapter(IntSet set) Creates a new adaption of a set of int
values to a Java Collections Framework set. |
Method Summary | |
public boolean | add(Object o) Adds an element to this set. | public void | clear() Clears this collection. | public boolean | contains(Object o) Indicates whether this set contains a specified
element. | public int | hashCode() Returns a hash code value for this set. | public Iterator | iterator() Returns an iterator over this set. | public boolean | remove(Object o) Removes a specified element from this set.
The unwrapped element is removed from the underlying set.
Note that this set can never contain null
values or values of other classes than
Integer Integer .
In those cases, this method will return false.
Parameters: o - the Integer value to remove from this set. | public boolean | retainAll(Collection c) Retains only the elements of a specified collection in
this set. | public int | size() Returns the number of elements in this set. |
IntSetToSetAdapter | public IntSetToSetAdapter(IntSet set)(Code) | | Creates a new adaption of a set of int
values to a Java Collections Framework set.
Parameters: set - the underlying primitive set. throws: NullPointerException - if set is null. |
add | public boolean add(Object o)(Code) | | Adds an element to this set. The unwrapped element is added
to the underlying set.
Parameters: o - the element to add to this set. true if this set was modifiedas a result of adding o; returnsfalse otherwise. throws: IllegalArgumentException - if o is null. throws: ClassCastException - if o is not of class Integer Integer. throws: UnsupportedOperationException - if the operation is not supported by theunderlying set. |
clear | public void clear()(Code) | | Clears this collection. The underlying set is
cleared.
throws: UnsupportedOperationException - if the operation is not supported by theunderlying set. |
contains | public boolean contains(Object o)(Code) | | Indicates whether this set contains a specified
element. For this set to contain an object, the
underlying set must contain its unwrapped value.
Note that this set can never contain null
values or values of other classes than
Integer Integer .
In those cases, this method will return false.
Parameters: o - the element to test for containment. true if o is contained in thisset; returns false otherwise. |
hashCode | public int hashCode()(Code) | | Returns a hash code value for this set. The hash code
returned is that of the underlying set.
a hash code value for this set. |
iterator | public Iterator iterator()(Code) | | Returns an iterator over this set.
an iterator over this set. |
remove | public boolean remove(Object o)(Code) | | Removes a specified element from this set.
The unwrapped element is removed from the underlying set.
Note that this set can never contain null
values or values of other classes than
Integer Integer .
In those cases, this method will return false.
Parameters: o - the Integer value to remove from this set. true if this set was modifiedas a result of removing o; returnsfalse otherwise. throws: UnsupportedOperationException - if the operation is not supported by the underlying set. |
retainAll | public boolean retainAll(Collection c)(Code) | | Retains only the elements of a specified collection in
this set. The unwrapped elements are removed from
the underlying set.
This method is only overridden to work
around a bug in
AbstractSet AbstractSet ,
which does not throw a
NullPointerException NullPointerException when the
argument is null and the set is empty. The
bug is inherited from
java.util.AbstractCollection java.util.AbstractCollection .
Parameters: c - the collection whose elements to retain in thiscollection. true if this set was modifiedas a result of removing the elements not containedin c;returns false otherwise. throws: UnsupportedOperationException - if the operation is not supported by the underlyingset. throws: NullPointerException - if c is null. |
size | public int size()(Code) | | Returns the number of elements in this set. The
number of elements is the same as that of the underlying
set.
the number of elements in this set. |
|
|
|