org.geotools.measure
Class Angle

java.lang.Object
  extended byorg.geotools.measure.Angle
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
Latitude, Longitude

public class Angle
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

An angle in degrees. An angle is the amount of rotation needed to bring one line or plane into coincidence with another, generally measured in degrees, sexagesimal degrees or grads.

Since:
2.0
Version:
$Id: Angle.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Latitude, Longitude, AngleFormat, Serialized Form

Constructor Summary
Angle(double theta)
          Contruct a new angle with the specified value.
Angle(java.lang.String string)
          Constructs a newly allocated object that represents the angle value represented by the string.
 
Method Summary
 int compareTo(java.lang.Object that)
          Compares two objects numerically.
 double degrees()
          Returns the angle value in degrees.
 boolean equals(java.lang.Object object)
          Compares the specified object with this angle for equality.
 int hashCode()
          Returns a hash code for this object.
 double radians()
          Returns the angle value in radians.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Angle

public Angle(double theta)
Contruct a new angle with the specified value.

Parameters:
theta - Angle in degrees.

Angle

public Angle(java.lang.String string)
      throws java.lang.NumberFormatException
Constructs a newly allocated object that represents the angle value represented by the string. The string should represents an angle in either fractional degrees (e.g. 45.5?) or degrees with minutes and seconds (e.g. 45?30').

Parameters:
string - A string to be converted to an .
Throws:
java.lang.NumberFormatException - if the string does not contain a parsable angle.
Method Detail

degrees

public double degrees()
Returns the angle value in degrees.


radians

public double radians()
Returns the angle value in radians.


hashCode

public int hashCode()
Returns a hash code for this object.


equals

public boolean equals(java.lang.Object object)
Compares the specified object with this angle for equality.


compareTo

public int compareTo(java.lang.Object that)
Compares two objects numerically. The comparaison is done as if by the Double.compare(double,double) method.

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Returns a string representation of this object.



Copyright © GeoTools. All Rights Reserved.