Modifier and Type | Field and Description |
---|---|
static Direction |
DOWN
Decodes the down direction.
|
static Direction |
LEFT
Decodes the left direction.
|
static Direction |
RIGHT
Decodes the right direction.
|
static Direction |
UP
Decodes the up direction.
|
Modifier and Type | Method and Description |
---|---|
int |
getDirection()
Returns the direction encoded as an integer value.
|
Direction |
getMirror()
Gets the mirror direction.
|
Direction |
getTurnCCW()
Gets the direction that follows this direction in counterclockwise order.
|
Direction |
getTurnCW()
Gets the direction that follows this direction in clockwise order.
|
boolean |
isHorizontal()
|
boolean |
isVertical()
|
String |
toString()
Returns a string representation of the direction.
|
public static final Direction DOWN
public static final Direction LEFT
public static final Direction RIGHT
public static final Direction UP
public final int getDirection()
public final Direction getMirror()
The new direction is turned 180
degrees compared to this instance.
IllegalArgumentException
- if the current direction value is invalidpublic final Direction getTurnCCW()
The new direction is turned 90
degrees in counterclockwise direction compared to this instance.
IllegalArgumentException
- if the current direction value is invalidpublic final Direction getTurnCW()
The new direction is turned 90
degrees in clockwise direction compared to this instance.
IllegalArgumentException
- if the current direction value is invalidpublic final boolean isHorizontal()
true
if this direction is horizontal, false
otherwisepublic final boolean isVertical()
true
if this direction is vertical, false
otherwise