- java.lang.Object
-
- java.lang.Enum<Direction>
-
- io.github.mmm.base.placement.Direction
-
- All Implemented Interfaces:
Serializable
,Comparable<Direction>
public enum Direction extends Enum<Direction>
This enum contains all possible directions.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DOWN
Direction down (south/bottom).DOWN_LEFT
Direction down-left (south-west).DOWN_RIGHT
Direction down-right (south-east).LEFT
Direction left (west).RIGHT
Direction right (east).UP
Direction up (north/top).UP_LEFT
Direction up-left (north-west).UP_RIGHT
Direction up-right (north-east).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getValue()
boolean
isDown()
boolean
isLeft()
boolean
isRight()
boolean
isUp()
String
toString()
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.
-
-
-
Enum Constant Detail
-
DOWN
public static final Direction DOWN
Direction down (south/bottom).
-
RIGHT
public static final Direction RIGHT
Direction right (east).
-
LEFT
public static final Direction LEFT
Direction left (west).
-
UP
public static final Direction UP
Direction up (north/top).
-
DOWN_RIGHT
public static final Direction DOWN_RIGHT
Direction down-right (south-east).
-
DOWN_LEFT
public static final Direction DOWN_LEFT
Direction down-left (south-west).
-
UP_RIGHT
public static final Direction UP_RIGHT
Direction up-right (north-east).
-
UP_LEFT
public static final Direction UP_LEFT
Direction up-left (north-west).
-
-
Method Detail
-
values
public static Direction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Direction c : Direction.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Direction valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public String getValue()
- Returns:
- the shortcut representation.
-
isRight
public boolean isRight()
- Returns:
true
if pointing right (RIGHT
,DOWN_RIGHT
, orUP_RIGHT
),false
otherwise.
-
isLeft
public boolean isLeft()
-
isDown
public boolean isDown()
- Returns:
true
if pointing down (DOWN
,DOWN_RIGHT
, orDOWN_LEFT
),false
otherwise.
-
-