public class TLcdAltitudeDescriptor extends Object
Describes how special altitude values should be interpreted. It maps double
altitude values to TLcdAltitudeInterpretation
s and vice versa.
Modifier | Constructor and Description |
---|---|
protected |
TLcdAltitudeDescriptor()
Creates an altitude descriptor with an empty special value mapping.
|
|
TLcdAltitudeDescriptor(Map<Double,TLcdAltitudeInterpretation> aSpecialValueMap)
Creates an altitude descriptor with the specified map.
|
Modifier and Type | Method and Description |
---|---|
static TLcdAltitudeDescriptor |
getDefaultInstance()
Returns the default altitude descriptor with the default mapping.
|
double |
getSpecialValue(TLcdAltitudeInterpretation aInterpretation)
Returns a special value for the specified interpretation.
|
TLcdAltitudeInterpretation |
getSpecialValueInterpretation(double aSpecialValue)
Returns an interpretation for the specified special value.
|
Map<Double,TLcdAltitudeInterpretation> |
getSpecialValueMappingAsMap()
Returns the mapping between special altitude values and altitude interpretations.
|
boolean |
isSpecialValue(double aValue)
Determines whether the specified altitude value is special or not.
|
protected TLcdAltitudeDescriptor()
public TLcdAltitudeDescriptor(Map<Double,TLcdAltitudeInterpretation> aSpecialValueMap)
Creates an altitude descriptor with the specified map. The mapping is required to use keys
of type Double
and values of type TLcdAltitudeInterpretation
.
Note that the map is converted to an unmodifiable map to keep the instance immutable.
aSpecialValueMap
- the special value mapping to be used by this instance.public static TLcdAltitudeDescriptor getDefaultInstance()
Returns the default altitude descriptor with the default mapping. The table
below shows the default mapping:
special altitude value | interpretation |
---|---|
Double.NaN | UNKNOWN_ELEVATION |
Integer.MIN_VALUE + 1 | OUTSIDE_RASTER_BOUNDS |
Integer.MIN_VALUE + 2 | OUTSIDE_SHAPE |
Note that the special value interval [ Integer.MIN_VALUE + 1,
Integer.MIN_VALUE + 100 ]
is reserved for future use.
When a special altitude value is required, it is recommended to use the altitude interpretation instead of copying the above values. An altitude descriptor maps the interpretation on a special altitude value.
public Map<Double,TLcdAltitudeInterpretation> getSpecialValueMappingAsMap()
Returns the mapping between special altitude values and altitude interpretations. The
keys of this map are Double
s and represent the special value. The values
of this map are TLcdAltitudeInterpretation
s.
Note that the returned map is unmodifiable. Attempts to modify the map, whether
direct or via its collection views, result in an UnsupportedOperationException
.
public boolean isSpecialValue(double aValue)
TLcdAltitudeInterpretation
is found for that value.aValue
- The altitude value to check.true
if the value is special, false
otherwise.public double getSpecialValue(TLcdAltitudeInterpretation aInterpretation)
Returns a special value for the specified interpretation.
Note that an IllegalArgumentException
is thrown if this
descriptor does not know how to map the specified interpretation.
aInterpretation
- The interpretation to map.IllegalArgumentException
- if this descriptor does not know how to map
the specified interpretation.public TLcdAltitudeInterpretation getSpecialValueInterpretation(double aSpecialValue)
Returns an interpretation for the specified special value.
Note that the specified value is required to be special according to the method
isSpecialValue(double)
, otherwise an IllegalArgumentException
will be thrown.
aSpecialValue
- The special value to map.IllegalArgumentException
- if the specified value is not special.