Enum Constant and Description |
---|
BOTTOM_LEFT |
BOTTOM_RIGHT |
CENTER |
DOWN |
LEFT |
RIGHT |
TOP_LEFT |
TOP_RIGHT |
UP |
Modifier and Type | Method and Description |
---|---|
static Direction |
fromInt(int d)
Return the direction that this number refers to.
|
java.lang.String |
getString()
Return a string representation of this direction.
|
Direction |
nextDirection(boolean clockwise)
Return the next direction, going clockwise (if cw = true)
or anticlockwise (if cw = false)
|
Direction |
oppositeDirection()
Return the opposite direction
|
static Direction |
randomDirection()
Return a random direction
|
static Direction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Direction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Direction UP
public static final Direction DOWN
public static final Direction LEFT
public static final Direction RIGHT
public static final Direction TOP_RIGHT
public static final Direction TOP_LEFT
public static final Direction BOTTOM_LEFT
public static final Direction BOTTOM_RIGHT
public static final Direction CENTER
public static Direction[] values()
for (Direction c : Direction.values()) System.out.println(c);
public static Direction valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic Direction oppositeDirection()
public Direction nextDirection(boolean clockwise)
clockwise
- public static Direction randomDirection()
public static Direction fromInt(int d)
public java.lang.String getString()