Package com.adobe.xfa.ut
Class Angle
- java.lang.Object
 - 
- com.adobe.xfa.ut.Angle
 
 
- 
public final class Angle extends java.lang.ObjectA class to represent an angle between 0° and 360°.Instances of this class are immutable. All change operations return a new instance of this
Angleclass. 
- 
- 
Constructor Summary
Constructors Constructor Description Angle()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.Angle(Angle source)Deprecated.Angle is immutable, so there is no need to copy an instance. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Angleadd(Angle oAdd)Returns anAnglerepresenting the addition of this object and the givenAngle.intdegrees()Gets this object's angle value.booleanequals(java.lang.Object object)Determines if this object is equal to the given Object.doublegetAngle()Gets this object's angle value.booleangt(Angle compare)Determines if this object is greater than the givenAngle.booleangte(Angle compare)Determines if this object is greater than or equal to the givenAngle.inthashCode()Returns a hash code value for the object.booleanlt(Angle compare)Determines if this object is less than the givenAngle.booleanlte(Angle compare)Determines if this object is less than or equal to the givenAngle.Anglesubtract(Angle subtract)Returns anAnglerepresenting the subtraction of this object and the givenAngle.java.lang.StringtoString()Returns a string representation of this object.static Anglezero()The zero angle. 
 - 
 
- 
- 
Field Detail
- 
ZERO
public static final Angle ZERO
TheAnglecorresponding to the 0 angle. 
 - 
 
- 
Constructor Detail
- 
Angle
public Angle()
Instantiates anAngleof 0°. 
- 
Angle
public Angle(Angle source)
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 Detail
- 
add
public Angle add(Angle oAdd)
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
public boolean equals(java.lang.Object object)
Determines if this object is equal to the given Object.- Overrides:
 equalsin classjava.lang.Object- Parameters:
 object- the angle to compare.- Returns:
 - true if equal, false otherwise.
 
 
- 
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
 hashCodein classjava.lang.Object
 
- 
getAngle
public double getAngle()
Gets this object's angle value.- Returns:
 - the angle in degrees.
 
 
- 
gt
public boolean gt(Angle compare)
Determines if this object is greater than the givenAngle.- Parameters:
 compare- theAngleto compare.- Returns:
 - true if greater than, false otherwise.
 
 
- 
gte
public boolean gte(Angle compare)
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
public boolean lt(Angle compare)
Determines if this object is less than the givenAngle.- Parameters:
 compare- theAngleto compare.- Returns:
 - true if less than, false otherwise.
 
 
- 
lte
public boolean lte(Angle compare)
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
public Angle subtract(Angle subtract)
Returns anAnglerepresenting the subtraction of this object and the givenAngle.- Parameters:
 subtract- theAngleto subtract.- Returns:
 - an angle of the subtraction.
 
 
- 
toString
public java.lang.String toString()
Returns a string representation of this object.- Overrides:
 toStringin classjava.lang.Object
 
- 
zero
public static Angle zero()
The zero angle.- Returns:
 - the angle equal to 0°.
 
 
 - 
 
 -