XFA4J

com.adobe.xfa.ut
Class Angle

java.lang.Object
  extended by com.adobe.xfa.ut.Angle

public final class Angle
extends java.lang.Object

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.


Constructor Summary
Angle()
          Instantiates an Angle of 0°.
Angle(Angle source)
          Deprecated. Angle is immutable, so there is no need to copy an instance.
Angle(double dDegrees)
          Instantiates an Angle from the given double value.
Angle(int nDegrees)
          Instantiates an Angle from the given int value.
Angle(long nDegrees)
          Instantiates an Angle from the given long value.
 
Method Summary
 Angle add(Angle oAdd)
          Returns an Angle representing the addition of this object and the given Angle.
 int degrees()
          Gets this object's angle value.
 boolean equals(java.lang.Object object)
          Determines if this object is equal to the given Object.
 double getAngle()
          Gets this object's angle value.
 boolean gt(Angle compare)
          Determines if this object is greater than the given Angle.
 boolean gte(Angle compare)
          Determines if this object is greater than or equal to the given Angle.
 boolean lt(Angle compare)
          Determines if this object is less than the given Angle.
 boolean lte(Angle compare)
          Determines if this object is less than or equal to the given Angle.
 Angle subtract(Angle subtract)
          Returns an Angle representing the subtraction of this object and the given Angle.
static Angle zero()
          The zero angle.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Angle

public Angle()
Instantiates an Angle of 0°.


Angle

public Angle(Angle source)
Deprecated. Angle is immutable, so there is no need to copy an instance.

Instantiates an Angle from the given Angle.

Parameters:
source - the Angle to copy to this object.

Angle

public Angle(double dDegrees)
Instantiates an Angle from 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 an Angle from the given int value.

Parameters:
nDegrees - the degree of the angle.

Angle

public Angle(long nDegrees)
Instantiates an Angle from the given long value.

Parameters:
nDegrees - the degree of the angle.
Method Detail

add

public Angle add(Angle oAdd)
Returns an Angle representing the addition of this object and the given Angle.

Parameters:
oAdd - the Angle to 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:
equals in class java.lang.Object
Parameters:
object - the angle to compare.
Returns:
true if equal, false otherwise.

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 given Angle.

Parameters:
compare - the Angle to 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 given Angle.

Parameters:
compare - the Angle to 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 given Angle.

Parameters:
compare - the Angle to 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 given Angle.

Parameters:
compare - the Angle to compare.
Returns:
true if less than or equal to, false otherwise.

subtract

public Angle subtract(Angle subtract)
Returns an Angle representing the subtraction of this object and the given Angle.

Parameters:
subtract - the Angle to subtract.
Returns:
an angle of the subtraction.

zero

public static Angle zero()
The zero angle.

Returns:
the angle equal to 0°.

XFA4J

© 2005 Adobe Systems Incorporated. All Rights Reserved.