public enum Direction extends Enum<Direction>
| Modifier and Type | Method and Description |
|---|---|
boolean |
isHorizontal() |
boolean |
isVertical() |
Direction |
left()
The direction 90-degrees to the left.
|
Direction |
left(int n)
The direction 90*n-degrees to the left.
|
Direction |
move(int n)
The direction 90*n-degrees to the right or left.
|
static Direction |
parseValue(String symbol) |
static Direction |
random() |
Direction |
reverse() |
Direction |
right()
The direction 90-degrees to the right.
|
Direction |
right(int n)
The direction 90*n-degrees to the right.
|
String |
symbol() |
static Direction |
valueOf(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 EAST
public static final Direction NORTH
public static final Direction SOUTH
public static final Direction WEST
public static Direction[] values()
for (Direction c : Direction.values()) System.out.println(c);
public static Direction 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 String symbol()
public boolean isHorizontal()
public boolean isVertical()
public Direction reverse()
public Direction move(int n)
n - public Direction right()
public Direction right(int n)
n - public Direction left()
public Direction left(int n)
n - public static Direction random()
Copyright © 2020. All rights reserved.