| org.geotools.util.NumberRange
All known Subclasses: org.geotools.util.MeasurementRange,
NumberRange | public class NumberRange extends Range (Code) | | A range of numbers.
and
are computed as usual, except that widening conversions will be applied as needed.
since: 2.0 version: $Id: NumberRange.java 26601 2007-08-19 23:16:35Z desruisseaux $ author: Martin DesruisseauxNumberRange.getMinValueNumberRange.getMaxValue |
Constructor Summary | |
public | NumberRange(byte minimum, byte maximum) Constructs an inclusive range of
byte values. | public | NumberRange(byte minimum, boolean isMinIncluded, byte maximum, boolean isMaxIncluded) Constructs a range of
byte values. | public | NumberRange(short minimum, short maximum) Constructs an inclusive range of
short values. | public | NumberRange(short minimum, boolean isMinIncluded, short maximum, boolean isMaxIncluded) Constructs a range of
short values. | public | NumberRange(int minimum, int maximum) Constructs an inclusive range of
int values. | public | NumberRange(int minimum, boolean isMinIncluded, int maximum, boolean isMaxIncluded) Constructs a range of
int values. | public | NumberRange(long minimum, long maximum) Constructs an inclusive range of
long values. | public | NumberRange(long minimum, boolean isMinIncluded, long maximum, boolean isMaxIncluded) Constructs a range of
long values. | public | NumberRange(float minimum, float maximum) Constructs an inclusive range of
float values. | public | NumberRange(float minimum, boolean isMinIncluded, float maximum, boolean isMaxIncluded) Constructs a range of
float values. | public | NumberRange(double minimum, double maximum) Constructs an inclusive range of
double values. | public | NumberRange(double minimum, boolean isMinIncluded, double maximum, boolean isMaxIncluded) Constructs a range of
double values. | | NumberRange(Class type, Comparable minimum, Comparable maximum) Constructs an inclusive range of
Comparable objects. | public | NumberRange(Class type, Number minimum, Number maximum) Constructs an inclusive range of
Number objects. | public | NumberRange(Class type, Number minimum, boolean isMinIncluded, Number maximum, boolean isMaxIncluded) Constructs a range of
Number objects. | | NumberRange(Class type, Range range) Constructs a range with the same values than the specified range,
casted to the specified type.
Parameters: type - The element class, usually one of Byte, Short,Integer, Long, Float or Double. Parameters: range - The range to copy. | public | NumberRange(Range range) Constructs a range with the same type and the same values than the specified range.
This is a copy constructor.
Parameters: range - The range to copy. |
Method Summary | |
public NumberRange | castTo(Class type) Casts this range to the specified type.
Parameters: type - The class to cast to. | public boolean | contains(Comparable value) Returns
true if the specified value is within this range. | public boolean | contains(Number value) Returns
true if the specified value is within this range. | public boolean | contains(Range range) Returns true if the supplied range is fully contained within this range. | NumberRange | convertAndCast(Range range, Class type) Casts the specified range to the specified type. | public double | getMaximum() Returns the
as a
double . | public double | getMaximum(boolean inclusive) Returns the
with the specified inclusive or
exclusive state. | public double | getMinimum() Returns the
as a
double . | public double | getMinimum(boolean inclusive) Returns the
with the specified inclusive or
exclusive state. | public Range | intersect(Range range) Returns the intersection of this range with the given range. | public boolean | intersects(Range range) Returns true if this range intersects the given range. | public Range[] | subtract(Range range) Returns the range of values that are in this range but not in the given range. | public Range | union(Range range) Returns the union of this range with the given range. | public static NumberRange | wrap(Range range) Wraps the specified
Range in a
NumberRange object. |
NumberRange | public NumberRange(byte minimum, byte maximum)(Code) | | Constructs an inclusive range of
byte values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(byte minimum, boolean isMinIncluded, byte maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
byte values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(short minimum, short maximum)(Code) | | Constructs an inclusive range of
short values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(short minimum, boolean isMinIncluded, short maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
short values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(int minimum, int maximum)(Code) | | Constructs an inclusive range of
int values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(int minimum, boolean isMinIncluded, int maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
int values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(long minimum, long maximum)(Code) | | Constructs an inclusive range of
long values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(long minimum, boolean isMinIncluded, long maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
long values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(float minimum, float maximum)(Code) | | Constructs an inclusive range of
float values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(float minimum, boolean isMinIncluded, float maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
float values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(double minimum, double maximum)(Code) | | Constructs an inclusive range of
double values.
Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(double minimum, boolean isMinIncluded, double maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
double values.
Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(Class type, Number minimum, Number maximum)(Code) | | Constructs an inclusive range of
Number objects.
Parameters: type - The element class, usually one of Byte, Short,Integer, Long, Float or Double. Parameters: minimum - The minimum value, inclusive. Parameters: maximum - The maximum value, inclusive. |
NumberRange | public NumberRange(Class type, Number minimum, boolean isMinIncluded, Number maximum, boolean isMaxIncluded)(Code) | | Constructs a range of
Number objects.
Parameters: type - The element class, usually one of Byte, Short,Integer, Long, Float or Double. Parameters: minimum - The minimum value. Parameters: isMinIncluded - Defines whether the minimum value is included in the Range. Parameters: maximum - The maximum value. Parameters: isMaxIncluded - Defines whether the maximum value is included in the Range. |
NumberRange | public NumberRange(Range range) throws ClassCastException(Code) | | Constructs a range with the same type and the same values than the specified range.
This is a copy constructor.
Parameters: range - The range to copy. The elements must be Number instances. throws: ClassCastException - if some elements are not instances of Number. since: 2.4 |
contains | public boolean contains(Comparable value)(Code) | | Returns
true if the specified value is within this range.
|
contains | public boolean contains(Number value)(Code) | | Returns
true if the specified value is within this range.
|
contains | public boolean contains(Range range)(Code) | | Returns true if the supplied range is fully contained within this range.
|
convertAndCast | NumberRange convertAndCast(Range range, Class type)(Code) | | Casts the specified range to the specified type. If this class is associated to a unit of
measurement, then this method convert the
range units to the same units than this
instance. This method is overriden by
MeasurementRange only in the way described
above.
Parameters: type - The class to cast to. Must be one of Byte, Short,Integer, Long, Float or Double. The casted range, or range if no cast is needed. |
getMaximum | public double getMaximum(boolean inclusive)(Code) | | Returns the
with the specified inclusive or
exclusive state. If this range is unbounded, then
Double.POSITIVE_INFINITY is
returned.
Parameters: inclusive - true for the maximum value inclusive,or false for the maximum value exclusive. The maximum value, inclusive or exclusive as requested. |
getMinimum | public double getMinimum(boolean inclusive)(Code) | | Returns the
with the specified inclusive or
exclusive state. If this range is unbounded, then
Double.NEGATIVE_INFINITY is
returned.
Parameters: inclusive - true for the minimum value inclusive,or false for the minimum value exclusive. The minimum value, inclusive or exclusive as requested. |
intersect | public Range intersect(Range range)(Code) | | Returns the intersection of this range with the given range.
Widening conversions will be applied as needed.
NumberRange |
intersects | public boolean intersects(Range range)(Code) | | Returns true if this range intersects the given range.
|
subtract | public Range[] subtract(Range range)(Code) | | Returns the range of values that are in this range but not in the given range.
NumberRange |
union | public Range union(Range range)(Code) | | Returns the union of this range with the given range.
Widening conversions will be applied as needed.
NumberRange |
wrap | public static NumberRange wrap(Range range)(Code) | | Wraps the specified
Range in a
NumberRange object. If the specified
range is already an instance of
NumberRange , then it is returned unchanged.
Parameters: range - The range to wrap The same range than range as a NumberRange object. |
|
|