|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.moyoman.util.Point
|
+--org.moyoman.util.Stone
This class represents one stone. It is either black, white, or empty, and has a horizontal and vertical position between 0 and 18.
| Field Summary | |
private static Stone[][] |
blackStones
All of the black stone objects that are instantiated. |
private Color |
color
The color of the stone. |
private static Stone[][] |
emptyStones
All of the empty stone objects that are instantiated. |
private static Stone[][] |
whiteStones
All of the white stone objects that are instantiated. |
| Fields inherited from class org.moyoman.util.Point |
|
| Constructor Summary | |
protected |
Stone(Color c,
int x,
int y)
Create the Stone object. |
protected |
Stone(Stone s)
Create the Stone object. |
| Method Summary | |
Stone |
castToStone()
Get the Stone object corresponding to this one. |
Object |
clone()
Clone this object. |
boolean |
equals(Object o)
Comprare the object with this Stone object. |
static Stone |
get(Color c,
int x,
int y)
Get the Stone object with these attributes. |
static Stone |
get(Color c,
Point pt)
Get the Stone object with these attributes. |
Stone[] |
getAdjacentStonesOfSameColor()
Get the stones of the same color immediately adjacent to this one. |
Color |
getColor()
Return the color of the stone. |
int |
hashCode()
Get the hash code for this object. |
String |
toString()
Return a String representation of this object. |
| Methods inherited from class org.moyoman.util.Point |
castToPoint, get, getAdjacentPoints, getConcentricPoints, getX, getY, isInCorner, isOnSide |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private Color color
private static final Stone[][] blackStones
private static final Stone[][] whiteStones
private static final Stone[][] emptyStones
| Constructor Detail |
protected Stone(Color c,
int x,
int y)
throws IllegalArgumentException
c - The color of the stone.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.protected Stone(Stone s)
s - The Stone object.| Method Detail |
public static Stone get(Color c,
int x,
int y)
c - - The color of the stone to retrieve.x - - The x coordinate of the stone.y - - The y coordinate of the stone.
public static Stone get(Color c,
Point pt)
c - - The color of the stone to retrieve.pt - - The point at which to get the Stone.
public Stone castToStone()
public Color getColor()
public Stone[] getAdjacentStonesOfSameColor()
public int hashCode()
hashCode in class Pointpublic boolean equals(Object o)
equals in class Pointo - The object being compared.
public Object clone()
clone in class Pointpublic String toString()
toString in class Point
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||