Constructor and Description |
---|
Range()
Constructs a new range object.
|
Range(double min,
double max)
Constructs a new range object with the given minimum and maximum.
|
Modifier and Type | Method and Description |
---|---|
void |
aggregate(Object values,
boolean unsigned,
IndexValidator validator,
ProgressMonitor pm) |
static Range |
computeRangeByte(byte[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
byte array. |
static Range |
computeRangeDouble(double[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
double array. |
static Range |
computeRangeDouble(DoubleList values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
Range.DoubleList . |
static Range |
computeRangeFloat(float[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
float array. |
static Range |
computeRangeGeneric(Object values,
boolean unsigned,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
Object . |
static Range |
computeRangeInt(int[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
int array. |
static Range |
computeRangeShort(short[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
short array. |
static Range |
computeRangeUByte(byte[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
byte array. |
static Range |
computeRangeUInt(int[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
int array. |
static Range |
computeRangeUShort(short[] values,
IndexValidator validator,
Range range,
ProgressMonitor pm)
Computes the value range for the values in the given
short array. |
double |
getMax()
Gets the maximum value.
|
double |
getMin()
Gets the mimimum value.
|
boolean |
isValid()
Checks if this range is valid.
|
void |
setMax(double max)
Sets the maximum value.
|
void |
setMin(double min)
Sets the mimimum value.
|
void |
setMinMax(double min,
double max)
Sets the mimimum and maximum value.
|
String |
toString() |
public Range()
public Range(double min, double max)
min
- the minimum valuemax
- the maximum valuepublic double getMin()
public void setMin(double min)
min
- the mimimum valuepublic double getMax()
public void setMax(double max)
max
- the maximum valuepublic void setMinMax(double min, double max)
min
- the mimimum valuemax
- the maximum valuepublic boolean isValid()
true
if minimum value is greater than the maximum valuepublic void aggregate(Object values, boolean unsigned, IndexValidator validator, ProgressMonitor pm)
public static Range computeRangeByte(byte[] values, IndexValidator validator, Range range, ProgressMonitor pm)
byte
array. The array elements are interpreted
as signed byte values. Values at a given index i
for which validator.validate(i)
returns false
are excluded from the computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeUByte(byte[] values, IndexValidator validator, Range range, ProgressMonitor pm)
byte
array. The array elements are interpreted
as unsigned byte values. Values at a given index i
for which
validator.validate(i)
returns false
are excluded from the computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeShort(short[] values, IndexValidator validator, Range range, ProgressMonitor pm)
short
array. The array elements are interpreted
as signed short values. Values at a given index i
for which
validator.validate(i)
returns false
are excluded from the computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeUShort(short[] values, IndexValidator validator, Range range, ProgressMonitor pm)
short
array. The array elements are interpreted
as unsigned short values. Values at a given index i
for which
validator.validate(i)
returns false
are excluded from the computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpublic static Range computeRangeInt(int[] values, IndexValidator validator, Range range, ProgressMonitor pm)
int
array. The array elements are interpreted
as signed int values. Values at a given index i
for which validator.validate(i)
returns false
are excluded from the computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeUInt(int[] values, IndexValidator validator, Range range, ProgressMonitor pm)
int
array. The array elements are interpreted
as unsigned int values. Values at a given index i
for which
validator.validate(i)
returns false
are excluded from the computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeFloat(float[] values, IndexValidator validator, Range range, ProgressMonitor pm)
float
array. Values at a given index
i
for which validator.validate(i)
returns false
are excluded from the
computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeDouble(double[] values, IndexValidator validator, Range range, ProgressMonitor pm)
double
array. Values at a given index
i
for which validator.validate(i)
returns false
are excluded from the
computation.values
- the array whose value range to computevalidator
- used to validate the array indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeDouble(DoubleList values, IndexValidator validator, Range range, ProgressMonitor pm)
Range.DoubleList
. Values at a given index
i
for which validator.validate(i)
returns false
are excluded from the
computation.values
- the Range.DoubleList
whose value range to computevalidator
- used to validate the indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progresspublic static Range computeRangeGeneric(Object values, boolean unsigned, IndexValidator validator, Range range, ProgressMonitor pm)
Object
. Values at a given index i
for which validator.validate(i)
returns false
are excluded from the computation. byte[], short[], int[], float[], double[], DoubleList
values
- the Object
whose value range to computeunsigned
- if true interprete all the values as unsignet type.validator
- used to validate the indexes, must not be null
. Use IndexValidator.TRUE
instead.range
- if not null
, used as return value, otherwise a new instance is createdpm
- a monitor to inform the user about progressIllegalArgumentException
- if the given object is not an istance of the supported types.Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.