view
Class MyPoint
java.lang.Object
java.awt.geom.Point2D
java.awt.Point
view.MyPoint
- All Implemented Interfaces:
- Serializable, Cloneable
public class MyPoint
- extends Point
An extension to point allowing construction with a comma-separated
string.
- See Also:
- Serialized Form
| Fields inherited from class java.awt.Point |
x, y |
MyPoint
public MyPoint()
MyPoint
public MyPoint(Point p)
MyPoint
public MyPoint(int x,
int y)
MyPoint
public MyPoint(String desc)
- Constrcuts a new point from a comma-separated string. If the string
cannot be parsed an IllegalArgumentException is thrown.
parsePoint
public static Point parsePoint(String desc)
- Parses a point from a String. Throws an IllegalArgumentException if
parsing fails.
toString
public static String toString(Point p)
- Overrides the string representation. Here, output is reduced to a
simple two-integer string, separated by a comma. The output string is
feasable for direct-passing it to the constructor of this class.
The static version also works with the original Point
class.
toString
public String toString()
- Overrides the string representation. Here, output is reduced to a
simple two-integer string, separated by a comma. The output string is
feasable for direct-passing it to the constructor of this class.
- Overrides:
toString in class Point