public static enum AbstractPerson.Direction extends java.lang.Enum<AbstractPerson.Direction>
Enum Constant and Description |
---|
EAST
person is facing east
|
NORTH
person is facing north
|
SOUTH
person is facing south
|
WEST
person is facing west
|
Modifier and Type | Method and Description |
---|---|
int |
getDx()
Getter for dx.
|
int |
getDy()
Getter for dy.
|
AbstractPerson.Direction |
getOpposite()
This method takes the current direction and gets the opposite direction
|
static AbstractPerson.Direction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AbstractPerson.Direction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AbstractPerson.Direction NORTH
public static final AbstractPerson.Direction SOUTH
public static final AbstractPerson.Direction EAST
public static final AbstractPerson.Direction WEST
public static AbstractPerson.Direction[] values()
for (AbstractPerson.Direction c : AbstractPerson.Direction.values()) System.out.println(c);
public static AbstractPerson.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 int getDx()
public int getDy()
public AbstractPerson.Direction getOpposite()