ucar.unidata.geoloc
Class ProjectionPointImpl

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.geom.Point2D.Double
          extended by ucar.unidata.geoloc.ProjectionPointImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ProjectionPoint

public class ProjectionPointImpl
extends java.awt.geom.Point2D.Double
implements ProjectionPoint, java.io.Serializable

Our implementation of ProjectionPoint, that subclasses java.awt.geom.Point2D to add serialization.

Author:
John Caron
See Also:
ProjectionPoint, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
 
Fields inherited from class java.awt.geom.Point2D.Double
x, y
 
Constructor Summary
ProjectionPointImpl()
          Default constructor, initialized to 0,0
ProjectionPointImpl(double x, double y)
          Constructor, initialized to x, y
ProjectionPointImpl(java.awt.geom.Point2D pt)
          Constructor that copies Point2D values into this.
ProjectionPointImpl(ProjectionPoint pt)
          Constructor that copies ProjectionPoint values into this.
 
Method Summary
 boolean equals(ProjectionPoint pt)
          Returns true if this represents the same point as pt.
 boolean isInfinite()
          See if either coordinate is +/- infinite.
static boolean isInfinite(ProjectionPoint pt)
          See if either coordinate in pt is +/- infinite.
 void setLocation(java.awt.geom.Point2D pt)
          set x,y location from pt
 void setLocation(ProjectionPoint pt)
          set x,y location from pt
 java.lang.String toString()
          nicely format this point
 void toString(java.util.Formatter f)
           
 
Methods inherited from class java.awt.geom.Point2D.Double
getX, getY, setLocation
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.unidata.geoloc.ProjectionPoint
getX, getY
 

Constructor Detail

ProjectionPointImpl

public ProjectionPointImpl()
Default constructor, initialized to 0,0


ProjectionPointImpl

public ProjectionPointImpl(java.awt.geom.Point2D pt)
Constructor that copies Point2D values into this.

Parameters:
pt - point to copy

ProjectionPointImpl

public ProjectionPointImpl(ProjectionPoint pt)
Constructor that copies ProjectionPoint values into this.

Parameters:
pt - point to copy

ProjectionPointImpl

public ProjectionPointImpl(double x,
                           double y)
Constructor, initialized to x, y

Parameters:
x - x coordinate
y - y coordinate
Method Detail

equals

public boolean equals(ProjectionPoint pt)
Returns true if this represents the same point as pt.

Specified by:
equals in interface ProjectionPoint
Parameters:
pt - point to check
Returns:
true if this represents the same point as pt.

toString

public java.lang.String toString()
nicely format this point

Overrides:
toString in class java.awt.geom.Point2D.Double
Returns:
nicely formatted point

toString

public void toString(java.util.Formatter f)

setLocation

public void setLocation(ProjectionPoint pt)
set x,y location from pt

Parameters:
pt - point to use for values

setLocation

public void setLocation(java.awt.geom.Point2D pt)
set x,y location from pt

Overrides:
setLocation in class java.awt.geom.Point2D
Parameters:
pt - point to use for values

isInfinite

public boolean isInfinite()
See if either coordinate is +/- infinite. This happens sometimes in projective geometry.

Returns:
true if either coordinate is +/- infinite.

isInfinite

public static boolean isInfinite(ProjectionPoint pt)
See if either coordinate in pt is +/- infinite. This happens sometimes in projective geometry.

Parameters:
pt - point to check
Returns:
true if either coordinate is +/- infinite.