org.shapelogic.polygon
Class CPointInt
java.lang.Object
java.awt.geom.Point2D
java.awt.Point
org.shapelogic.polygon.CPointInt
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IPoint2D>, GeometricShape2D, IPoint2D, PointReplacable<IPoint2D>
public class CPointInt
- extends java.awt.Point
- implements IPoint2D
Simple point that is comparable and has arithmetic operations.
C Point Int means Comparable Point based on integers
Sub classed from Java2D Point
- Author:
- Sami Badawi
- 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.Point |
x, y |
Methods inherited from class java.awt.Point |
equals, getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate |
Methods inherited from class java.awt.geom.Point2D |
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
CPointInt
public CPointInt(java.awt.geom.Point2D point)
CPointInt
public CPointInt(int x,
int y)
CPointInt
public CPointInt()
compareTo
public int compareTo(IPoint2D that)
- Specified by:
compareTo
in interface java.lang.Comparable<IPoint2D>
minus
public IPoint2D minus(IPoint2D that)
- Subtract other point from this
- Specified by:
minus
in interface IPoint2D
add
public IPoint2D add(IPoint2D that)
- Add other point into this
- Specified by:
add
in interface IPoint2D
multiply
public IPoint2D multiply(double multiplier)
- Multiply number with each coordinate of this
- Specified by:
multiply
in interface IPoint2D
isNull
public boolean isNull()
- Test if point is (0,0)
- Specified by:
isNull
in interface IPoint2D
toDoubleArray
public double[] toDoubleArray()
- Create double array with this info in
- Specified by:
toDoubleArray
in interface IPoint2D
max
public IPoint2D max(IPoint2D that)
- Specified by:
max
in interface IPoint2D
min
public IPoint2D min(IPoint2D that)
- Specified by:
min
in interface IPoint2D
distance
public double distance(IPoint2D that)
- Specified by:
distance
in interface IPoint2D
round
public IPoint2D round()
- Specified by:
round
in interface IPoint2D
copy
public IPoint2D copy()
- Specified by:
copy
in interface IPoint2D
angle
public double angle()
- Specified by:
angle
in interface IPoint2D
isOnAxis
public boolean isOnAxis()
- Specified by:
isOnAxis
in interface IPoint2D
isOnDiagonal
public boolean isOnDiagonal()
- Specified by:
isOnDiagonal
in interface IPoint2D
distanceFromOrigin
public double distanceFromOrigin()
- Specified by:
distanceFromOrigin
in interface IPoint2D
turn90
public IPoint2D turn90()
- Specified by:
turn90
in interface IPoint2D
getCenter
public IPoint2D getCenter()
- Specified by:
getCenter
in interface GeometricShape2D
getDiameter
public double getDiameter()
- Specified by:
getDiameter
in interface GeometricShape2D
replacePointsInMap
public IPoint2D replacePointsInMap(java.util.Map<IPoint2D,IPoint2D> pointReplacementMap,
AnnotatedShapeImplementation annotatedShape)
- Specified by:
replacePointsInMap
in interface PointReplacable<IPoint2D>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.awt.Point
Copyright © 2008. All Rights Reserved.