@JsType(isNative=true)
public class Point
extends java.lang.Object
| Constructor and Description |
|---|
Point(java.lang.Number newX,
java.lang.Number newY)
Instantiates a new point.
|
| Modifier and Type | Method and Description |
|---|---|
Point |
add(Point otherPoint)
Returns the result of addition of the current and the given points.
|
Point |
clone() |
java.lang.Boolean |
contains(Point point)
Returns true if the both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).
|
java.lang.Number |
distanceTo(Point otherPoint)
Returns the distance between the current and the given points.
|
Point |
divideBy(java.lang.Number number,
java.lang.Boolean round)
Returns the result of division of the current point by the given number.
|
java.lang.Boolean |
equals(Point otherPoint)
Returns true if the given point has the same coordinates.
|
Point |
floor()
Returns a copy of the current point with floored coordinates (rounded down).
|
Point |
multiplyBy(java.lang.Number number)
Returns the result of multiplication of the current point by the given number.
|
Point |
round()
Returns a copy of the current point with rounded coordinates.
|
Point |
subtract(Point otherPoint)
Returns the result of subtraction of the given point from the current.
|
java.lang.String |
toString() |
@JsConstructor
public Point(java.lang.Number newX,
java.lang.Number newY)
newX - the new XnewY - the new Y@JsMethod public Point add(Point otherPoint)
otherPoint - the other point@JsMethod public Point subtract(Point otherPoint)
otherPoint - the other point@JsMethod public Point multiplyBy(java.lang.Number number)
number - the number@JsMethod public Point divideBy(java.lang.Number number, java.lang.Boolean round)
number - the numberround - the round@JsMethod public java.lang.Number distanceTo(Point otherPoint)
otherPoint - the other point@JsMethod public Point clone()
clone in class java.lang.Object@JsMethod public Point round()
@JsMethod public Point floor()
@JsMethod public java.lang.Boolean contains(Point point)
point - the point@JsMethod public java.lang.Boolean equals(Point otherPoint)
otherPoint - the other point@JsMethod public java.lang.String toString()
toString in class java.lang.Object