Package com.graphbuilder.geom
Class PointFactory.Point2D
java.lang.Object
com.graphbuilder.geom.PointFactory.Point2D
- Enclosing class:
PointFactory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns either a new array or internal temporary array with a copy of the data or a direct reference to the array.doublegetX()Returns the x-coordinate.doublegetY()Returns the y-coordinate.voidsetLocation(double[] p) Sets the location of the point.voidsetLocation(double x, double y) Sets the location of the point.
-
Field Details
-
pts
double[] pts
-
-
Constructor Details
-
Point2D
public Point2D(double x, double y)
-
-
Method Details
-
getX
public double getX()Description copied from interface:Point2dReturns the x-coordinate. -
getY
public double getY()Description copied from interface:Point2dReturns the y-coordinate. -
setLocation
public void setLocation(double[] p) Description copied from interface:PointSets the location of the point. Some implementations may copy the values of the array or may set the internal reference to the array. Some implementations may check the length of the array or the values. If the values need to be restricted, then the getLocation() method should return a copy of the data.- Specified by:
setLocationin interfacePoint
-
setLocation
public void setLocation(double x, double y) Description copied from interface:Point2dSets the location of the point.- Specified by:
setLocationin interfacePoint2d
-
getLocation
public double[] getLocation()Description copied from interface:PointReturns either a new array or internal temporary array with a copy of the data or a direct reference to the array. In the case where a copy is returned and later modified, the setLocation must be called to apply the data. The values in the returned array must represent the absolute location of the point.- Specified by:
getLocationin interfacePoint
-