Package info.kwarc.kalah
Enum KalahState.Player
- java.lang.Object
-
- java.lang.Enum<KalahState.Player>
-
- info.kwarc.kalah.KalahState.Player
-
- All Implemented Interfaces:
Serializable
,Comparable<KalahState.Player>
- Enclosing class:
- KalahState
public static enum KalahState.Player extends Enum<KalahState.Player>
The players are North and South.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description KalahState.Player
other()
Returns the other player.static KalahState.Player
valueOf(String name)
Returns the enum constant of this type with the specified name.static KalahState.Player[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NORTH
public static final KalahState.Player NORTH
The Northern/upper/Black player, moves second.
-
SOUTH
public static final KalahState.Player SOUTH
The Southern/lower/White player, moves first.
-
-
Method Detail
-
values
public static KalahState.Player[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (KalahState.Player c : KalahState.Player.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KalahState.Player valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
other
public KalahState.Player other()
Returns the other player.
-
-