|
|||||||||||
| 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
|
+--org.moyoman.util.NumberedStone
This class represents a stone and the move number it was made on. Note that while there are only 361 total Point objects and 1083 Stone objects ever created, a new NumberedStone object is created each time one is needed. Therefore, it may be less useful in applications such as lookahead search, where large numbers of objects are used.
| Field Summary | |
private short |
number
The number of the move. |
| Fields inherited from class org.moyoman.util.Stone |
|
| Fields inherited from class org.moyoman.util.Point |
|
| Constructor Summary | |
NumberedStone(int num,
Stone s)
Create a new NumberedStone object. |
|
NumberedStone(short num,
Color color,
int x,
int y)
Create a new NumberedStone object. |
|
NumberedStone(short num,
Stone s)
Create a new NumberedStone object. |
|
| Method Summary | |
Object |
clone()
Return a clone of this object. |
boolean |
equals(Object o)
Compare this object with another for equality. |
short |
getMoveNumber()
Get the number of the move. |
int |
hashCode()
Get a unique integer which represents this object. |
String |
toString()
Get a String representation of the object. |
| Methods inherited from class org.moyoman.util.Stone |
castToStone, get, get, getAdjacentStonesOfSameColor, getColor |
| 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 short number
| Constructor Detail |
public NumberedStone(short num,
Color color,
int x,
int y)
throws IllegalArgumentException
num - The move number.color - The color of the move.x - The horizontal coordinate of the move.y - The vertical coordinate of the move.
IllegalArgumentException - Thrown if the x or y coordinates
are out of range.
public NumberedStone(short num,
Stone s)
throws IllegalArgumentException
num - The move number.s - The stone which is the move.
IllegalArgumentException - Thrown if the x or y coordinates are
out of range.
public NumberedStone(int num,
Stone s)
throws IllegalArgumentException
num - The move number.s - The stone which is the move.
IllegalArgumentException - Thrown if the x or y coordinates are
out of range.| Method Detail |
public short getMoveNumber()
public String toString()
toString in class Stonepublic int hashCode()
hashCode in class Stonepublic boolean equals(Object o)
equals in class Stoneo - The object to be compared with this one.
public Object clone()
clone in class Stone
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||