net.japanesechess.record
Enum Tokens
java.lang.Object
java.lang.Enum<Tokens>
net.japanesechess.record.Tokens
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Tokens>
public enum Tokens
- extends java.lang.Enum<Tokens>
|
Method Summary |
Tokens |
intToToken(int iVal)
|
abstract boolean |
isValidMove(byte[] board,
Handicap handicap,
boolean promoted,
boolean black,
int x1,
java.lang.String y1,
int x2,
java.lang.String y2)
Valid in the sense used here, does not mean any checks other than, if the
board were blank, and this were the only piece on the board, could it move
here? Sometimes there may be additional checks for blocking tokens of the
same color. |
int |
toInt()
|
java.lang.String |
toString()
|
static Tokens |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Tokens[] |
values()
Returns an array containing the constants of this enum type, in
the order they're declared. |
| Methods inherited from class java.lang.Enum |
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
KING
public static final Tokens KING
ROOK
public static final Tokens ROOK
BISHOP
public static final Tokens BISHOP
GOLD
public static final Tokens GOLD
SILVER
public static final Tokens SILVER
LANCE
public static final Tokens LANCE
KNIGHT
public static final Tokens KNIGHT
PAWN
public static final Tokens PAWN
notation
private java.lang.String notation
number
private int number
values
public static final Tokens[] values()
- Returns an array containing the constants of this enum type, in
the order they're declared. This method may be used to iterate
over the constants as follows:
for(Tokens c : Tokens.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they're declared
valueOf
public static Tokens valueOf(java.lang.String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Enum<Tokens>
toInt
public int toInt()
intToToken
public Tokens intToToken(int iVal)
isValidMove
public abstract boolean isValidMove(byte[] board,
Handicap handicap,
boolean promoted,
boolean black,
int x1,
java.lang.String y1,
int x2,
java.lang.String y2)
- Valid in the sense used here, does not mean any checks other than, if the
board were blank, and this were the only piece on the board, could it move
here? Sometimes there may be additional checks for blocking tokens of the
same color.
- Returns: