public final class CoordPair extends Object
Instances of this class are immutable. All change operations
return a new instance of this CoordPair class.
| Modifier and Type | Field and Description |
|---|---|
static CoordPair |
ZERO_ZERO
The
CoordPair corresponding to the (0, 0) origin. |
| Constructor and Description |
|---|
CoordPair()
Instantiates a
CoordPair with the coordinate (0, 0). |
CoordPair(CoordPair source)
Deprecated.
CoordPair is immutable, so there is no need to copy an instance.
|
CoordPair(UnitSpan x,
UnitSpan y)
Instantiates a
CoordPair from the given UnitSpan(s). |
| Modifier and Type | Method and Description |
|---|---|
CoordPair |
add(CoordPair add)
Returns a
CoordPair representing the
addition of this object and the given CoordPair. |
boolean |
equals(Object object)
Determines if this object is equal to the given
Object. |
CoordPair |
grid(CoordPair grid)
Returns a
CoordPair representing this
CoordPair snaped to the nearest
grid coordinates of the given CoordPair. |
boolean |
gt(CoordPair compare)
Determines if this object is greater than the given
CoordPair. |
int |
hashCode() |
boolean |
lt(CoordPair compare)
Determines if this object is less than the given
CoordPair. |
boolean |
notEquals(Object compare)
Determines if this object is not equal to the given
Object. |
CoordPair |
rotatePoint(CoordPair oRPoint,
Angle oAngle)
Returns a
CoordPair representing the
rotation of this object through the given Angle
and about the given CoordPair. |
CoordPair |
round(CoordPair round)
Returns a
CoordPair representing the
rounding of this object's coordinates to the given CoordPair. |
CoordPair |
scale(double dXScale,
double dYScale)
Returns a
CoordPair representing the
scaling of this object to the given scaling factors. |
CoordPair |
subtract(CoordPair subtract)
Returns a
CoordPair representing the
subtraction of this object and the given CoordPair. |
UnitSpan |
x()
Gets this object's x coordinate.
|
UnitSpan |
y()
Gets this object's y coordinate.
|
static CoordPair |
zeroZero()
The zero (0, 0) coordinate.
|
public static final CoordPair ZERO_ZERO
CoordPair corresponding to the (0, 0) origin.public CoordPair()
CoordPair with the coordinate (0, 0).zeroZero()public CoordPair(CoordPair source)
CoordPair from the given CoordPair.source - the CoordPair to copy to this object.public CoordPair grid(CoordPair grid)
CoordPair representing this
CoordPair snaped to the nearest
grid coordinates of the given CoordPair.grid - the grid coordinateUnitSpan.grid(UnitSpan)public CoordPair round(CoordPair round)
CoordPair representing the
rounding of this object's coordinates to the given CoordPair.round - the rounding coordinate.UnitSpan.round(UnitSpan)public UnitSpan x()
public UnitSpan y()
public CoordPair rotatePoint(CoordPair oRPoint, Angle oAngle)
CoordPair representing the
rotation of this object through the given Angle
and about the given CoordPair.oRPoint - the point of rotation.oAngle - the angle of rotation.public boolean equals(Object object)
Object.
Comparisons with instances of non-CoordPair objects are never equal.
When comparing instances of CoordPair objects,
the object's UnitSpan coordinates
are each compared for equality.equals in class Objectobject - the Object to compare.UnitSpan.equals(Object)public boolean notEquals(Object compare)
Object.
Comparisons with instances of non-CoordPair objects are always not equal.
When comparing instances of CoordPair objects,
the object's UnitSpan coordinates
are each compared for inequality.compare - the Object to compare.equals(Object)public CoordPair add(CoordPair add)
CoordPair representing the
addition of this object and the given CoordPair.add - the CoordPair to add.public CoordPair subtract(CoordPair subtract)
CoordPair representing the
subtraction of this object and the given CoordPair.subtract - the CoordPair to subtract.public CoordPair scale(double dXScale, double dYScale)
CoordPair representing the
scaling of this object to the given scaling factors.dXScale - the X coordinate scaling factor.dYScale - the Y coordinate scaling factor.public boolean gt(CoordPair compare)
CoordPair.
Coordinate comparisons rules are as follows: order by the y coordnate first,
and if equal, then by the x coordinate.compare - the CoordPair to compare.public boolean lt(CoordPair compare)
CoordPair.
Coordinate comparisons rules as as follows: order by the y coordnate first,
and if equal, then by the x coordinate.compare - the CoordPair to compare.public static CoordPair zeroZero()
Copyright © 2010 - 2020 Adobe. All Rights Reserved