|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.util.Point
This class represents one point. It has a horizontal and vertical position between 0 and 18.
Field Summary | |
private int |
horizontal
The horizontal position of the point 0 - 18 |
private static Point[][] |
points
|
private int |
vertical
The vertical position of the point 0 - 18 |
Constructor Summary | |
protected |
Point(int x,
int y)
Create the Point object. |
Method Summary | |
Point |
castToPoint()
Return a Point object. |
Object |
clone()
Clone this object. |
boolean |
equals(Object o)
Return true if the object is equal to this Point object. |
static Point |
get(int x,
int y)
Get the specified point object. |
Point[] |
getAdjacentPoints()
Get the points adjacent to this one. |
Point[] |
getConcentricPoints(short distance)
Get the legal Point objects offset horizontally or vertically by the parameter. |
int |
getX()
Return the horizontal position of the point. |
int |
getY()
Return the vertical position of the point. |
int |
hashCode()
Return a unique value for each point. |
boolean |
isInCorner()
Determine if the point is in a corner of the board. |
boolean |
isOnSide()
Determine if the point is on a side of the board. |
String |
toString()
Get a String representation of this object. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private int horizontal
private int vertical
private static final Point[][] points
Constructor Detail |
protected Point(int x, int y) throws IllegalArgumentException
x
- The horizontal position, between 0 and 18.y
- The vertical position, between 0 and 18.
IllegalArgumentException
- Thrown if the x or
y parameters are out of range.Method Detail |
public static Point get(int x, int y) throws IllegalArgumentException
x
- The horizontal value of the Point.y
- The vertical value of the Point.
IllegalArgumentException
- Thrown if x or y is out of range.public Point castToPoint()
public int getX()
public int getY()
public Point[] getAdjacentPoints()
public Point[] getConcentricPoints(short distance)
distance
- The distance to offset the points.
public boolean isOnSide()
public boolean isInCorner()
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public Object clone()
clone
in class Object
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |