public enum KarelDirection extends Enum<KarelDirection>
Modifier and Type | Method and Description |
---|---|
static KarelDirection |
valueOf(int dir)
Converts an int like KarelWorld.NORTH into a KarelDirection.
|
static KarelDirection |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static KarelDirection[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final KarelDirection NORTH
public static final KarelDirection EAST
public static final KarelDirection SOUTH
public static final KarelDirection WEST
public static KarelDirection[] values()
for (KarelDirection c : KarelDirection.values()) System.out.println(c);
public static KarelDirection valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static KarelDirection valueOf(int dir)