Package com.adobe.xfa.ut
Class Angle
java.lang.Object
com.adobe.xfa.ut.Angle
A class to represent an angle between 0° and 360°.
Instances of this class are immutable. All change operations
return a new instance of this Angle class.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAngle()Instantiates anAngleof 0°.Angle(double dDegrees) Instantiates anAnglefrom the given double value.Angle(int nDegrees) Instantiates anAnglefrom the given int value.Angle(int value, boolean isResolved) Instantiates anAnglefrom the given int value.Angle(long nDegrees) Instantiates anAnglefrom the given long value.Deprecated.Angle is immutable, so there is no need to copy an instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns anAnglerepresenting the addition of this object and the givenAngle.intdegrees()Gets this object's angle value.booleanDetermines if this object is equal to the given Object.doublegetAngle()Gets this object's angle value.booleanDetermines if this object is greater than the givenAngle.booleanDetermines if this object is greater than or equal to the givenAngle.inthashCode()Returns a hash code value for the object.booleanDetermines if this object is less than the givenAngle.booleanDetermines if this object is less than or equal to the givenAngle.Returns anAnglerepresenting the subtraction of this object and the givenAngle.toString()Returns a string representation of this object.static Anglezero()The zero angle.
-
Field Details
-
ZERO
TheAnglecorresponding to the 0 angle.
-
-
Constructor Details
-
Angle
public Angle()Instantiates anAngleof 0°. -
Angle
Deprecated.Angle is immutable, so there is no need to copy an instance.Instantiates anAnglefrom the givenAngle.- Parameters:
source- theAngleto copy to this object.
-
Angle
public Angle(double dDegrees) Instantiates anAnglefrom the given double value. Angle values are expressed in degrees: e.g., 15.5 means 15 and 1/2 degrees, not 15 degrees and 50 minutes.- Parameters:
dDegrees- the degree of the angle.
-
Angle
public Angle(int nDegrees) Instantiates anAnglefrom the given int value.- Parameters:
nDegrees- the degree of the angle.
-
Angle
public Angle(long nDegrees) Instantiates anAnglefrom the given long value.- Parameters:
nDegrees- the degree of the angle.
-
Angle
public Angle(int value, boolean isResolved) Instantiates anAnglefrom the given int value.- Parameters:
value- the value of the angle.isResolved- when true, interpret the angle value as in unit of internal resolution; when false, interpret the angle value as a degree.
-
-
Method Details
-
add
Returns anAnglerepresenting the addition of this object and the givenAngle.- Parameters:
oAdd- theAngleto subtract.- Returns:
- an angle of the addition.
-
degrees
public int degrees()Gets this object's angle value.- Returns:
- the angle, in degrees, rounded to the closest integer.
-
equals
Determines if this object is equal to the given Object. -
hashCode
public int hashCode()Returns a hash code value for the object. -
getAngle
public double getAngle()Gets this object's angle value.- Returns:
- the angle in degrees.
-
gt
Determines if this object is greater than the givenAngle.- Parameters:
compare- theAngleto compare.- Returns:
- true if greater than, false otherwise.
-
gte
Determines if this object is greater than or equal to the givenAngle.- Parameters:
compare- theAngleto compare.- Returns:
- true if greater than, or equal to, false otherwise.
-
lt
Determines if this object is less than the givenAngle.- Parameters:
compare- theAngleto compare.- Returns:
- true if less than, false otherwise.
-
lte
Determines if this object is less than or equal to the givenAngle.- Parameters:
compare- theAngleto compare.- Returns:
- true if less than or equal to, false otherwise.
-
subtract
Returns anAnglerepresenting the subtraction of this object and the givenAngle.- Parameters:
subtract- theAngleto subtract.- Returns:
- an angle of the subtraction.
-
toString
Returns a string representation of this object. -
zero
The zero angle.- Returns:
- the angle equal to 0°.
-