|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.measure.angle.SexagesimalAngle
SexagesimalAngle provides a concrete implementation of Angle
which is designed for accurate manipulations of the sexagesimal sub-unit fields to
the minimum value of 1 microsecond of degree.
Angle,
DecimalAngle,
DecimalAngleUnit,
SexagesimalAngleType,
SexagesimalAngleUnit| Field Summary | |
protected long |
angle
The value of this SexagesimalAngle. |
| Constructor Summary | |
SexagesimalAngle()
Construct a SexagesimalAngle initialized to a value of 0. |
|
SexagesimalAngle(Angle ang)
Construct a SexagesimalAngle initialized to the specified value. |
|
SexagesimalAngle(DecimalAngleUnit units,
double value)
Construct a SexagesimalAngle initialized to the value and units specified. |
|
SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
double unitsValue)
Construct a SexagesimalAngle initialized to the value and units specified. |
|
SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
double minutes)
Construct a SexagesimalAngle initialized to the value and units specified. |
|
SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
double seconds)
Construct a SexagesimalAngle initialized to the value and units specified. |
|
SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
int seconds,
int microseconds)
Construct a SexagesimalAngle initialized to the value and units specified. |
|
| Method Summary | |
void |
add(Angle ang)
Add to this SexagesimalAngle the passed Angle. |
void |
add(DecimalAngleUnit units,
double value)
Add to this SexagesimalAngle the double value in the specified
DecimalAngleUnits. |
void |
add(SexagesimalAngleUnit units,
int value)
Add to this SexagesimalAngle the value in the specified SexagesimalAngleUnits. |
void |
changeSign()
Change the sign of this SexagesimalAngle. |
void |
clear()
Set the value of this SexagesimalAngle to 0. |
void |
clearAndSetField(SexagesimalAngleUnit units,
int value)
Clear the specified SexagesimalAngleUnit field of this
SexagesimalAngle object and set the specified integer value
to the field. |
void |
clearField(SexagesimalAngleUnit units)
Set the value of the specified SexagesimalAngleUnit field of this
SexagesimalAngle to 0. |
java.lang.Object |
clone()
Return a copy of this SexagesimalAngle object. |
int |
compareTo(Angle that)
Compare this object with the argument for order. |
int |
compareTo(java.lang.Object obj)
Compare this object with the argument for order. |
boolean |
equals(java.lang.Object obj)
Compare two Angles for equality. |
double |
get(DecimalAngleUnit units)
Return the double value of this SexagesimalAngle in the specified
DecimalAngleUnits. |
int |
getField(SexagesimalAngleUnit units)
Return the integer value for the specified field contained in this SexagesimalAngle object. |
int[] |
getFields(SexagesimalAngleType type)
Return the integer array of field values contained in this SexagesimalAngle
cooresponding to the specified SexagesimalAngleType. |
AngleSign |
getSign()
Get the AngleSign of this SexagesimalAngle. |
long |
getValueInMicroseconds(SexagesimalAngleType type)
Return the long value of this SexagesimalAngle in units of microseconds of
the specified SexagesimalAngleType. |
int |
hashCode()
Return the hashcode |
void |
normalize(AngleNorm option)
Normalize the value of this SexagesimalAngle as specified by the option field. |
void |
set(Angle ang)
Set this SexagesimalAngle to the specified value. |
void |
set(DecimalAngleUnit units,
double value)
Set the value of this SexagesimalAngle to the specified
DecimalAngleUnits value. |
void |
set(SexagesimalAngleType type,
AngleSign sign,
double unitsValue)
Set this SexagesimalAngle to the specified value in the SexagesimalAngleType. |
void |
set(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
double minutes)
Set this SexagesimalAngle to the specified value in the SexagesimalAngleType. |
void |
set(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
double seconds)
Set this SexagesimalAngle to the specified value in the SexagesimalAngleType. |
void |
set(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
int seconds,
int microseconds)
Set this SexagesimalAngle to the specified value in the SexagesimalAngleType. |
void |
setValueInMicroseconds(SexagesimalAngleType type,
long value)
Set this SexagesimalAngle to the specified value of microseconds of
the SexagesimalAngleType. |
void |
subtract(Angle ang)
Subtract from this SexagesimalAngle the passed Angle. |
java.lang.String |
toString()
Return a string representation of this SexagesimalAngle in decimal degrees. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long angle
SexagesimalAngle.
| Constructor Detail |
public SexagesimalAngle()
SexagesimalAngle initialized to a value of 0.
public SexagesimalAngle(Angle ang)
SexagesimalAngle initialized to the specified value.
ang - the Angle object to duplicate.
public SexagesimalAngle(DecimalAngleUnit units,
double value)
SexagesimalAngle initialized to the value and units specified.
units - the DecimalAngleUnits of value being input.value - the input value
public SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
double unitsValue)
SexagesimalAngle initialized to the value and units specified.
type - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the double value of the primary units of the SexagesimalAngleType.
public SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
double minutes)
SexagesimalAngle initialized to the value and units specified.
type - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the integer value of the primary units of the SexagesimalAngleType.minutes - the double value of the minutes sub-unit of the SexagesimalAngleType.
public SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
double seconds)
SexagesimalAngle initialized to the value and units specified.
type - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the integer value of the primary units of the SexagesimalAngleType.minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.seconds - the double value of the seconds sub-unit of the SexagesimalAngleType.
public SexagesimalAngle(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
int seconds,
int microseconds)
SexagesimalAngle initialized to the value and units specified.
type - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the integer value of the primary units of the SexagesimalAngleType.minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.seconds - the integer value of the seconds sub-unit of the SexagesimalAngleType.microseconds - the integer value of the microseconds sub-unit of the
SexagesimalAngleType.| Method Detail |
public void set(Angle ang)
SexagesimalAngle to the specified value.
set in interface Angleang - the Angle object to duplicate.public void clear()
SexagesimalAngle to 0.
clear in interface Anglepublic void changeSign()
SexagesimalAngle.
changeSign in interface Anglepublic AngleSign getSign()
AngleSign of this SexagesimalAngle.
getSign in interface AngleAngleSign.POSITIVE by default.public void add(Angle ang)
SexagesimalAngle the passed Angle.
add in interface Angleang - an Angle.public void subtract(Angle ang)
SexagesimalAngle the passed Angle.
subtract in interface Angleang - an Angle.public void normalize(AngleNorm option)
SexagesimalAngle as specified by the option field.
normalize in interface Angleoption - the AngleNorm identifier
Note: java.lang.Math trigonometric functions have precision problems with very large angle values. Therefore, angles of very large size should be normalized prior to passing their values to java.lang.Math trigonometric functions.
public void set(DecimalAngleUnit units,
double value)
SexagesimalAngle to the specified
DecimalAngleUnits value.
set in interface Angleunits - the DecimalAngleUnits.value - the double value.public double get(DecimalAngleUnit units)
SexagesimalAngle in the specified
DecimalAngleUnits.
get in interface Angleunits - the DecimalAngleUnits.
Angle.
public void add(DecimalAngleUnit units,
double value)
SexagesimalAngle the double value in the specified
DecimalAngleUnits.
add in interface Angleunits - the DecimalAngleUnits.value - the double value.
public void set(SexagesimalAngleType type,
AngleSign sign,
double unitsValue)
SexagesimalAngle to the specified value in the SexagesimalAngleType.
set in interface Angletype - the SexagesimalAngleType.sign - the AngleSign.unitsValue - double integer value of the primary units of the SexagesimalAngleType.
public void set(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
double minutes)
SexagesimalAngle to the specified value in the SexagesimalAngleType.
set in interface Angletype - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the integer value of the primary units of the SexagesimalAngleType.minutes - the double value of the minutes sub-unit of the SexagesimalAngleType.
public void set(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
double seconds)
SexagesimalAngle to the specified value in the SexagesimalAngleType.
set in interface Angletype - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the integer value of the primary units of the SexagesimalAngleType.minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.seconds - the double value of the seconds sub-unit of the SexagesimalAngleType.
public void set(SexagesimalAngleType type,
AngleSign sign,
int unitsValue,
int minutes,
int seconds,
int microseconds)
SexagesimalAngle to the specified value in the SexagesimalAngleType.
set in interface Angletype - the SexagesimalAngleType.sign - the AngleSign.unitsValue - the integer value of the primary units of the SexagesimalAngleType.minutes - the integer value of the minutes sub-unit of the SexagesimalAngleType.seconds - the integer value of the seconds sub-unit of the SexagesimalAngleType.microseconds - the integer value of the microseconds sub-unit of the
SexagesimalAngleType.
public void setValueInMicroseconds(SexagesimalAngleType type,
long value)
SexagesimalAngle to the specified value of microseconds of
the SexagesimalAngleType. (i.e. either in microseconds of
of degree or microseconds of hour)
setValueInMicroseconds in interface Angletype - the SexagesimalAngleType.value - the long value in microseconds to set for this Angle.public long getValueInMicroseconds(SexagesimalAngleType type)
SexagesimalAngle in units of microseconds of
the specified SexagesimalAngleType. (i.e. either in microseconds of
of degree or microseconds of hour)
getValueInMicroseconds in interface Angletype - the SexagesimalAngleType.
Angle in microseconds.
public void add(SexagesimalAngleUnit units,
int value)
SexagesimalAngle the value in the specified SexagesimalAngleUnits.
add in interface Angleunits - the SexagesimalAngleUnits.value - the integer value.public void clearField(SexagesimalAngleUnit units)
SexagesimalAngleUnit field of this
SexagesimalAngle to 0.
units - the SexagesimalAngleUnit field to clear;public int[] getFields(SexagesimalAngleType type)
SexagesimalAngle
cooresponding to the specified SexagesimalAngleType.
type - the SexagesimalAngleType of the fields to return.
Notes:
1) Very large angles with hour/degree fields larger than an int will be truncated.
2) The sign of the angle is maintained for the total value, not by individual field. The values returned will always be positive. To determine the sign of the angle, use the getSign( ) method.
public int getField(SexagesimalAngleUnit units)
SexagesimalAngle object.
units - the SexagesimalAngleUnit field being requested;
Notes:
1) Very large angles with hour/degree fields larger than an int will be truncated.
2) The sign of the angle is maintained for the total value, not by individual field. The value returned will always be positive. To determine the the sign of the angle, use the getSign( ) method.
public void clearAndSetField(SexagesimalAngleUnit units,
int value)
SexagesimalAngleUnit field of this
SexagesimalAngle object and set the specified integer value
to the field.
units - the SexagesimalAngleUnit field to clear and add to.value - the value to add to the field.
Notes: This method is a convenience combination of clearField( units ) followed by add( units, value ). The sign of the value is adjusted based on the sign of the complete angle object (i.e. value is set positive if the angle is positive, value is set negative if the angle is negative). The implications of this are: 1) Specifying a value that is greater than the maximum field value (59 for minutes or seconds, 999999 for microseconds) will result in a change to more significant fields (i.e. subunits). 2) Specifying a negative value will result in changes to fields other than the one specified as the operation becomes a decrement by the value to the field which has been set to 0 by the clear operation.
public java.lang.Object clone()
SexagesimalAngle object. Overrides Cloneable.
SexagesimalAngle object.public int hashCode()
public boolean equals(java.lang.Object obj)
Angles for equality. The result is true
if and only if the argument object is not null, is an Angle object
( including classes implementing Angle ) and represents an angle
of the same sign and magnitude as this Angle.
obj - the object to compare with
true if the Angles are the same;
false otherwise.public java.lang.String toString()
SexagesimalAngle in decimal degrees.
SexagesimalAnglepublic int compareTo(Angle that)
compareTo in interface Anglethat - the Angle to compare
public int compareTo(java.lang.Object obj)
compareTo in interface Angleobj - the Object to compare
ClassCastException - if the argument is not an
Angle.
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||