ch.javasoft.util.intcoll
Class AbstractSortedIntSet
java.lang.Object
ch.javasoft.util.intcoll.AbstractIntCollection
ch.javasoft.util.intcoll.AbstractSortedIntSet
- All Implemented Interfaces:
- IntCollection, IntIterable, IntSet, SortedIntSet, Iterable<Integer>, Collection<Integer>, Set<Integer>, SortedSet<Integer>
- Direct Known Subclasses:
- BitSetIntSet, DefaultIntSet, RangeIntSet
public abstract class AbstractSortedIntSet
- extends AbstractIntCollection
- implements SortedIntSet
Implementation of IntSet, also implementing SortedSet, but with
support limited to positive integers.
| Methods inherited from class ch.javasoft.util.intcoll.AbstractIntCollection |
add, addAll, addAll, addAll, addInt, clear, clone, contains, containsAll, containsInt, first, firstInt, hashCode, intIterator, isEmpty, iterator, last, lastInt, remove, removeAll, removeInt, retainAll, size, toArray, toArray, toArrayInternal, toIntArray, toIntArray, toIntArrayInternal, toString |
| Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
AbstractSortedIntSet
public AbstractSortedIntSet()
AbstractSortedIntSet
public AbstractSortedIntSet(IntCollection set)
AbstractSortedIntSet
public AbstractSortedIntSet(int[] values)
subSet
public SortedIntSet subSet(Integer fromElement,
Integer toElement)
- Specified by:
subSet in interface SortedIntSet- Specified by:
subSet in interface SortedSet<Integer>
headSet
public SortedIntSet headSet(int toElement)
- Description copied from interface:
SortedIntSet
- Returns a view of the portion of this set whose elements are
strictly less than toElement. The returned set is
backed by this set, so changes in the returned set are
reflected in this set, and vice-versa. The returned set
supports all optional set operations that this set supports.
The returned set will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
- Specified by:
headSet in interface SortedIntSet
- Parameters:
toElement - high endpoint (exclusive) of the returned set
- Returns:
- a view of the portion of this set whose elements are strictly
less than toElement
headSet
public SortedIntSet headSet(Integer toElement)
- Specified by:
headSet in interface SortedIntSet- Specified by:
headSet in interface SortedSet<Integer>
tailSet
public SortedIntSet tailSet(int fromElement)
- Description copied from interface:
SortedIntSet
- Returns a view of the portion of this set whose elements are
greater than or equal to fromElement. The returned
set is backed by this set, so changes in the returned set are
reflected in this set, and vice-versa. The returned set
supports all optional set operations that this set supports.
The returned set will throw an IllegalArgumentException
on an attempt to insert an element outside its range.
- Specified by:
tailSet in interface SortedIntSet
- Parameters:
fromElement - low endpoint (inclusive) of the returned set
- Returns:
- a view of the portion of this set whose elements are greater
than or equal to fromElement
tailSet
public SortedIntSet tailSet(Integer fromElement)
- Specified by:
tailSet in interface SortedIntSet- Specified by:
tailSet in interface SortedSet<Integer>
equals
public boolean equals(Object obj)
- Specified by:
equals in interface Collection<Integer>- Specified by:
equals in interface Set<Integer>- Overrides:
equals in class AbstractIntCollection