att.grappa
Class GrappaPoint
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Double
att.grappa.GrappaPoint
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class GrappaPoint
- extends java.awt.geom.Point2D.Double
This class extends java.awt.geom.Point2D.Double and provides built-in
string-to-Point2D and Point2D-to-string conversions suitable for Grappa.
- Version:
- 1.2, 21 Aug 2005; Copyright 1996 - 2005 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Fields inherited from class java.awt.geom.Point2D.Double |
x, y |
Constructor Summary |
GrappaPoint()
Constructs and initializes a GrappaPoint with
coordinates (0, 0). |
GrappaPoint(double x,
double y)
Constructs and initializes a GrappaPoint with the
specified coordinates. |
GrappaPoint(java.lang.String coordString)
Constructs and initializes a GrappaPoint with the
coordinates derived from the specified String representation. |
Method Summary |
java.lang.String |
toAttributeString()
Provides a string representation of this object consistent
with Grappa attributes. |
java.lang.String |
toFormattedString(java.lang.String format)
Provides a formatted string representation of this object. |
java.lang.String |
toString()
Provides a generic string representation of this object. |
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, setLocation |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
GrappaPoint
public GrappaPoint()
- Constructs and initializes a
GrappaPoint
with
coordinates (0, 0).
GrappaPoint
public GrappaPoint(double x,
double y)
- Constructs and initializes a
GrappaPoint
with the
specified coordinates.
- Parameters:
x, y
- the coordinates to which to set the newly
constructed GrappaPoint
GrappaPoint
public GrappaPoint(java.lang.String coordString)
- Constructs and initializes a
GrappaPoint
with the
coordinates derived from the specified String representation.
The String format should be: "x-coord,y-coord"
- Parameters:
coordString
- String representing the coordinates to which to
set the newly constructed GrappaPoint
toAttributeString
public java.lang.String toAttributeString()
- Provides a string representation of this object consistent
with Grappa attributes.
- Returns:
- attribute-suitable string representation of this GrappaPoint.
toFormattedString
public java.lang.String toFormattedString(java.lang.String format)
- Provides a formatted string representation of this object.
- Parameters:
format
- the format used to build the string (%p is the base directive for a GrappaPoint).
- Returns:
- a string representation of this GrappaPoint.
toString
public java.lang.String toString()
- Provides a generic string representation of this object.
- Overrides:
toString
in class java.awt.geom.Point2D.Double
- Returns:
- a generic string representation of this GrappaPoint.