Modifier and Type | Field and Description |
---|---|
double |
x
Point X coordinate.
|
double |
y
Point Y coordinate.
|
Constructor and Description |
---|
Point(double x,
double y)
Constructor.
|
Point(Point point)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Point o)
Compares this object with the specified object for order.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
int |
hashCode()
Returns a hash code value for the object.
|
Point |
offset(double x,
double y)
Shift point to specified offset.
|
Point |
offset(Insets insets)
Shift point to specified offset.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
Point |
translate(double dx,
double dy)
Translate point object by specified offset without creating new instance.
|
Point |
translate(Insets insets)
Translate point object by specified offset without creating new instance.
|
Point |
translate(Point point)
Translate point object by specified offset without creating new instance.
|
public Point(double x, double y)
x
- Point X.y
- Point Y.public Point(Point point)
point
- Source point.public Point offset(Insets insets)
insets
- Source insets.public Point offset(double x, double y)
x
- X offset.y
- Y offset.public Point translate(Insets insets)
insets
- Source insets.this
for fluent syntax chained calls.public Point translate(double dx, double dy)
dx
- Delta X.dy
- Delta Y.this
for fluent syntax chained calls.public Point translate(Point point)
point
- Source point.this
for fluent syntax chained calls.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The other reference to compare to.public int compareTo(Point o)
compareTo
in interface java.lang.Comparable<Point>
o
- The object to be compared.java.lang.NullPointerException
- if the specified object is null