|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractCollection<E>
AbstractSet<Range<T>>
RangeSet<T>
T - The type of range elements.RangeSet.
@Deprecated public class RangeSet<T extends Comparable<? super T>>
An ordered set of ranges. RangeSet objects store an arbitrary number of
ranges in any Java primitives (int, float,
etc.) or any comparable objects.
Ranges can be added in any order. When a range is added, RangeSet first looks for an
existing range overlapping the specified range. If an overlapping range is found,
ranges are merged as of Range.union(Range). Consequently, ranges returned by
iterator() may not be the same than added ranges.
| utility/geotk-utility (download) | View source code for this class |
| Constructor Summary | |
|---|---|
RangeSet(Class<T> type)
Deprecated. Constructs an empty set of range. |
|
| Method Summary | |
|---|---|
boolean |
add(byte min,
byte max)
Deprecated. Adds a range of values to this set. |
boolean |
add(double min,
double max)
Deprecated. Adds a range of values to this set. |
boolean |
add(float min,
float max)
Deprecated. Adds a range of values to this set. |
boolean |
add(int min,
int max)
Deprecated. Adds a range of values to this set. |
boolean |
add(long min,
long max)
Deprecated. Adds a range of values to this set. |
boolean |
add(Range<T> range)
Deprecated. Adds a range to this set. |
boolean |
add(short min,
short max)
Deprecated. Adds a range of values to this set. |
boolean |
add(T min,
T max)
Deprecated. Adds a range of values to this set. |
void |
clear()
Deprecated. Remove all elements from this set of ranges. |
RangeSet<T> |
clone()
Deprecated. Returns a clone of this range set. |
Comparator<Range<T>> |
comparator()
Deprecated. Returns the comparator associated with this sorted set. |
boolean |
contains(Object object)
Deprecated. Returns true if this set contains the specified element. |
boolean |
equals(Object object)
Deprecated. Compares the specified object with this set of ranges for equality. |
Range<T> |
first()
Deprecated. Returns the first (lowest) range currently in this sorted set. |
Class<? extends Range<T>> |
getElementType()
Deprecated. Returns the type of elements in this collection. |
double |
getMaxValueAsDouble(int index)
Deprecated. Returns a range's maximum value as a double. |
double |
getMinValueAsDouble(int index)
Deprecated. Returns a range's minimum value as a double. |
int |
hashCode()
Deprecated. Returns a hash value for this set of ranges. |
SortedSet<Range<T>> |
headSet(Range<T> upper)
Deprecated. Returns a view of the portion of this sorted set whose elements are strictly less than upper. |
int |
indexOfRange(Comparable<?> value)
Deprecated. If the specified value is inside a range, returns the index of this range. |
Iterator<Range<T>> |
iterator()
Deprecated. Returns an iterator over the elements in this set of ranges. |
Range<T> |
last()
Deprecated. Returns the last (highest) range currently in this sorted set. |
boolean |
remove(byte min,
byte max)
Deprecated. Removes a range of values from this set. |
boolean |
remove(double min,
double max)
Deprecated. Removes a range of values from this set. |
boolean |
remove(float min,
float max)
Deprecated. Removes a range of values from this set. |
boolean |
remove(int min,
int max)
Deprecated. Removes a range of values from this set. |
boolean |
remove(long min,
long max)
Deprecated. Removes a range of values from this set. |
boolean |
remove(Object object)
Deprecated. Removes a range to this set. |
boolean |
remove(short min,
short max)
Deprecated. Removes a range of values from this set. |
boolean |
remove(T min,
T max)
Deprecated. Removes a range of values from this set. |
int |
size()
Deprecated. Returns the number of ranges in this set. |
SortedSet<Range<T>> |
subSet(Range<T> lower,
Range<T> upper)
Deprecated. Returns a view of the portion of this sorted set whose elements range from lower, inclusive, to upper, exclusive. |
SortedSet<Range<T>> |
tailSet(Range<T> lower)
Deprecated. Returns a view of the portion of this sorted set whose elements are greater than or equal to lower. |
String |
toString()
Deprecated. Returns a string representation of this set of ranges. |
void |
trimToSize()
Deprecated. Trims this set to the minimal amount of memory required for holding its data. |
| Methods inherited from class AbstractSet |
|---|
removeAll |
| Methods inherited from class AbstractCollection |
|---|
addAll, containsAll, isEmpty, retainAll, toArray, toArray |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface Set |
|---|
addAll, containsAll, isEmpty, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public RangeSet(Class<T> type)
type - The class of the range elements.| Method Detail |
|---|
public Class<? extends Range<T>> getElementType()
NumberRange
or DateRange class, or failing that the plain Range class.
getElementType in interface CheckedCollection<Range<T extends Comparable<? super T>>>getElementType in interface CheckedContainer<Range<T extends Comparable<? super T>>>public Comparator<Range<T>> comparator()
comparator in interface SortedSet<Range<T extends Comparable<? super T>>>public void clear()
clear in interface Collection<Range<T extends Comparable<? super T>>>clear in interface Set<Range<T extends Comparable<? super T>>>clear in class AbstractCollection<Range<T extends Comparable<? super T>>>public int size()
size in interface Collection<Range<T extends Comparable<? super T>>>size in interface Set<Range<T extends Comparable<? super T>>>size in class AbstractCollection<Range<T extends Comparable<? super T>>>public boolean add(Range<T> range)
Range.union(Range).
Note: current version do not support open intervals
(i.e. Range.is[Min/Max]Included() must return true).
add in interface Collection<Range<T extends Comparable<? super T>>>add in interface Set<Range<T extends Comparable<? super T>>>add in class AbstractCollection<Range<T extends Comparable<? super T>>>range - The range to add.
true if this set changed as a result of the call.
public boolean add(T min,
T max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean add(byte min,
byte max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean add(short min,
short max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean add(int min,
int max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean add(long min,
long max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean add(float min,
float max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean add(double min,
double max)
throws IllegalArgumentException
min - The lower value, inclusive.max - The upper value, inclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.public boolean remove(Object object)
Note: current version do not support closed intervals
(i.e. Range.is[Min/Max]Included() must return false).
remove in interface Collection<Range<T extends Comparable<? super T>>>remove in interface Set<Range<T extends Comparable<? super T>>>remove in class AbstractCollection<Range<T extends Comparable<? super T>>>object - The range to remove.
true if this set changed as a result of the call.
public boolean remove(T min,
T max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean remove(byte min,
byte max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean remove(short min,
short max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean remove(int min,
int max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean remove(long min,
long max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean remove(float min,
float max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public boolean remove(double min,
double max)
throws IllegalArgumentException
min - The lower value to remove, exclusive.max - The upper value to remove, exclusive.
true if this set changed as a result of the call.
IllegalArgumentException - if lower is greater than upper.
public final double getMinValueAsDouble(int index)
throws IndexOutOfBoundsException,
ClassCastException
double.
The index can be any value from 0 inclusive to the set's size
exclusive. The returned values always increase with index.
index - The range index, from 0 inclusive to size exclusive.
IndexOutOfBoundsException - if index is out of bounds.
ClassCastException - if range elements are not convertible to numbers.
public final double getMaxValueAsDouble(int index)
throws IndexOutOfBoundsException,
ClassCastException
double.
The index can be any value from 0 inclusive to the set's size
exclusive. The returned values always increase with index.
index - The range index, from 0 inclusive to size exclusive.
IndexOutOfBoundsException - if index is out of bounds.
ClassCastException - if range elements are not convertible to numbers.public int indexOfRange(Comparable<?> value)
-1.
value - The value to search.
public boolean contains(Object object)
true if this set contains the specified element.
contains in interface Collection<Range<T extends Comparable<? super T>>>contains in interface Set<Range<T extends Comparable<? super T>>>contains in class AbstractCollection<Range<T extends Comparable<? super T>>>object - The object to compare to this set.
true if the given object is equal to this set.
public Range<T> first()
throws NoSuchElementException
first in interface SortedSet<Range<T extends Comparable<? super T>>>NoSuchElementException - if the set is empty.
public Range<T> last()
throws NoSuchElementException
last in interface SortedSet<Range<T extends Comparable<? super T>>>NoSuchElementException - if the set is empty.
public SortedSet<Range<T>> subSet(Range<T> lower,
Range<T> upper)
lower, inclusive, to upper, exclusive.
subSet in interface SortedSet<Range<T extends Comparable<? super T>>>lower - Low endpoint (inclusive) of the sub set.upper - High endpoint (exclusive) of the sub set.
public SortedSet<Range<T>> headSet(Range<T> upper)
upper.
headSet in interface SortedSet<Range<T extends Comparable<? super T>>>upper - High endpoint (exclusive) of the headSet.
public SortedSet<Range<T>> tailSet(Range<T> lower)
lower.
tailSet in interface SortedSet<Range<T extends Comparable<? super T>>>lower - Low endpoint (inclusive) of the tailSet.
public Iterator<Range<T>> iterator()
Range objects.
iterator in interface Iterable<Range<T extends Comparable<? super T>>>iterator in interface Collection<Range<T extends Comparable<? super T>>>iterator in interface Set<Range<T extends Comparable<? super T>>>iterator in class AbstractCollection<Range<T extends Comparable<? super T>>>public final void trimToSize()
public int hashCode()
hashCode in interface Collection<Range<T extends Comparable<? super T>>>hashCode in interface Set<Range<T extends Comparable<? super T>>>hashCode in class AbstractSet<Range<T extends Comparable<? super T>>>public boolean equals(Object object)
equals in interface Collection<Range<T extends Comparable<? super T>>>equals in interface Set<Range<T extends Comparable<? super T>>>equals in class AbstractSet<Range<T extends Comparable<? super T>>>object - The object to compare with this range.
true if the given object is equal to this range.public RangeSet<T> clone()
clone in class ObjectObject.clone()public String toString()
toString in class AbstractCollection<Range<T extends Comparable<? super T>>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||