|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.zuercher.gpx2map.util.Point
public class Point
Point represents a location within an image.
Field Summary | |
---|---|
private int |
x
X coordinate of point. |
private int |
y
Y coordinate of point. |
Constructor Summary | |
---|---|
Point(int x,
int y)
Constructs a new Point with the given X and Y coordinates. |
Method Summary | |
---|---|
boolean |
above(Point other)
Tests if this pixel is strictly above another Point. |
boolean |
below(Point other)
Tests if this pixel is strictly below another Point. |
double |
distanceTo(Point other)
Computes the distance, in pixels, between this Point and another Point. |
boolean |
equals(Object other)
Tests whether this Point is equal to another Point. |
boolean |
equals(Point other)
Tests whether this Point is equal to another Point. |
int |
getX()
Returns the X coordinate for this Point. |
int |
getY()
Returns the Y coordinate for this Point. |
int |
hashCode()
Computes a hash code for this Point. |
boolean |
leftOf(Point other)
Tests if this pixel is strictly to the left of another Point. |
boolean |
rightOf(Point other)
Tests if this pixel is strictly to the right of another Point. |
String |
toString()
Returns a string representation of this Point. |
boolean |
within(Dimension bounds)
Tests whether this Point lies within the given Dimension . |
boolean |
within(Rectangle rectangle)
Tests whether this Point lies within the given Rectangle . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final int x
private final int y
Constructor Detail |
---|
public Point(int x, int y)
x
- x coordinatey
- y coordinateMethod Detail |
---|
public int getX()
public int getY()
public double distanceTo(Point other)
other
- another Point
public boolean above(Point other)
other
- another Point
this.y < other.y
public boolean below(Point other)
other
- another Point
this.y > other.y
public boolean leftOf(Point other)
other
- another Point
this.x < other.x
public boolean rightOf(Point other)
other
- another Point
this.x > other.x
public boolean within(Dimension bounds)
Dimension
.
bounds
- dimensions to test against
public boolean within(Rectangle rectangle)
Rectangle
.
rectangle
- the recentangle to test against
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Point other)
other
- the other Point
public boolean equals(Object other)
equals
in class Object
other
- the other Point
ClassCastException
- if other
is not a
Point
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |