| |
|
| java.util.AbstractSet bak.pcj.adapter.ShortSetToSetAdapter bak.pcj.adapter.ShortSortedSetToSortedSetAdapter
ShortSortedSetToSortedSetAdapter | public class ShortSortedSetToSortedSetAdapter extends ShortSetToSetAdapter implements SortedSet(Code) | | This class represents adapters of short 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: ShortSortedSet See Also: java.util.SortedSet author: Søren Bak version: 1.0 2002/12/04 since: 1.2 |
Method Summary | |
public Comparator | comparator() Returns the comparator used by this set. | public Object | first() Returns the lowest element of this set. | public SortedSet | headSet(Object to) Returns the subset of values lower than a specified value. | public Object | last() Returns the highest element of this set. | public SortedSet | subSet(Object from, Object to) Returns the subset of values lower that a specified value and
higher than or equal to another specified value. | public SortedSet | tailSet(Object from) Returns the subset of values higher than or equal to a
specified value. |
ShortSortedSetToSortedSetAdapter | public ShortSortedSetToSortedSetAdapter(ShortSortedSet set)(Code) | | Creates a new adaption of a set of short
values to a Java Collections Framework set.
Parameters: set - the underlying primitive set. throws: NullPointerException - if set is null. |
comparator | public Comparator comparator()(Code) | | Returns the comparator used by this set. This method
always returns null, since primitive sets are
sorted by their natural ordering.
null. |
first | public Object first()(Code) | | Returns the lowest element of this set.
the lowest element of this set. throws: NoSuchElementException - if this set is empty. |
headSet | public SortedSet headSet(Object to)(Code) | | Returns the subset of values lower than a specified value.
The returned subset is a view of this set, so changes to the
subset are reflected by this set and vice versa.
Parameters: to - the upper bound of the returned set (not included). throws: IllegalArgumentException - if to is not permittedin this set (which can be the case with returnedsubsets). throws: ClassCastException - if to is not of class Short Short. throws: NullPointerException - if to is null. |
last | public Object last()(Code) | | Returns the highest element of this set.
the highest element of this set. throws: NoSuchElementException - if this set is empty. |
subSet | public SortedSet subSet(Object from, Object to)(Code) | | Returns the subset of values lower that a specified value and
higher than or equal to another specified value.
The returned subset is a view of this set, so changes to the
subset are reflected by this set and vice versa.
Parameters: from - the lower bound of the returned set (included). Parameters: to - the upper bound of the returned set (not included). throws: IllegalArgumentException - if from is greater than to;if from or to is not permittedin this set (which can be the case with returnedsubsets). throws: ClassCastException - if from is not of class Short Short;if to is not of class Short Short. throws: NullPointerException - if from is null;if to is null. |
tailSet | public SortedSet tailSet(Object from)(Code) | | Returns the subset of values higher than or equal to a
specified value.
The returned subset is a view of this set, so changes to the
subset are reflected by this set and vice versa.
Parameters: from - the lower bound of the returned set (included). throws: IllegalArgumentException - if from is not permittedin this set (which can be the case with returnedsubsets). throws: ClassCastException - if from is not of class Short Short. throws: NullPointerException - if from is null. |
|
|
|