Class RadianCoordinate
java.lang.Object
ch.tocco.nice2.types.spi.geolocation.RadianCoordinate
- All Implemented Interfaces:
Coordinate,Serializable,Comparable<Coordinate>
Abstract Coordinate implemenation that stores coordinate values
normalized to RADIAN measure.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRadianCoordinate(String value, Unit unit, int rangePrecision) protectedRadianCoordinate(BigDecimal value, Unit unit, int rangePrecision) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckRange(int precision) Checks the value if it fits in the range of a coordinate.intdoublebooleanprotected abstract BigDecimalprotected abstract BigDecimalReturns the minimum value for this coordinate.getValue()protected static booleangreaterMaximumRange(BigDecimal value, int precision, BigDecimal maxVal) Returnstrue, if the specified value is out of range for this coordinate.inthashCode()protected booleanisInRange(BigDecimal value, int precision) protected booleanisMaxium(int precision) protected booleanisMinimum(int precision) protected static booleanlowerMinimumRange(BigDecimal value, int precision, BigDecimal minVal) doubleprotected BigDecimaltransformPhase(BigDecimal arg, int precision) Transforms the argument into an argument with the same value inside the valid range of this coordinate.protected booleanvalueEquals(BigDecimal value, int precision)
-
Field Details
-
DEFAULT_RANGE_PRECISION
protected static final int DEFAULT_RANGE_PRECISION- See Also:
-
value
-
-
Constructor Details
-
RadianCoordinate
-
RadianCoordinate
-
-
Method Details
-
getMinValue
Returns the minimum value for this coordinate.- Returns:
- minimum coordinate value
-
getMaxValue
- Returns:
- the maximum value for this coordinate
-
getValue
- Specified by:
getValuein interfaceCoordinate
-
radianValue
public double radianValue()- Specified by:
radianValuein interfaceCoordinate
-
degreeValue
public double degreeValue()- Specified by:
degreeValuein interfaceCoordinate
-
checkRange
Checks the value if it fits in the range of a coordinate. If a value very close (specified byprecision) to the limit is encountered, the range limit is set as new value.- Parameters:
precision- the number of scale digits that has to be equal. is the value exceeds a range limit by more than "precision" digits, the max (resp. min) is set- Throws:
IllegalArgumentException- if value is too much out of range
-
isInRange
-
greaterMaximumRange
Returnstrue, if the specified value is out of range for this coordinate. -
lowerMinimumRange
-
isMaxium
protected boolean isMaxium(int precision) -
isMinimum
protected boolean isMinimum(int precision) -
transformPhase
Transforms the argument into an argument with the same value inside the valid range of this coordinate.
- Parameters:
arg- an angle argument in RADprecision- the precision for which an argument is considered equal with its maximum/minimum values- Returns:
- the same coordinate within minuxm-maximum range
-
valueEquals
-
compareTo
- Specified by:
compareToin interfaceComparable<Coordinate>
-
equals
-
hashCode
public int hashCode()
-