|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<HexDirection>
util.HexDirection
public enum HexDirection
Represents the six directions out of a horizontal hexagon. |
![]() |
Enum Constant Summary | |
---|---|
DOWN
|
|
LOWER_LEFT
|
|
LOWER_RIGHT
|
|
UP
|
|
UPPER_LEFT
|
|
UPPER_RIGHT
|
Method Summary | |
---|---|
HexDirection |
clockwise()
Returns the next clockwise rotation. |
HexDirection |
counterClockwise()
Returns the next counter-clockwise rotation. |
static HexDirection |
fromString(String str)
Returns the enum representation of a string. |
Point |
getOffset(Point loc)
Returns a point offset in this direction according to inverted cartesian coordinates (the same as Graphics objects). |
boolean |
isUpper()
Returns if the direction has an upward orientation (upper left, up, or upper right). |
static HexDirection |
random()
Returns a random hexagonal direction. |
HexDirection |
reverse()
Returns the opposite facing direction. |
String |
toString()
|
static HexDirection |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static HexDirection[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final HexDirection UP
public static final HexDirection UPPER_RIGHT
public static final HexDirection LOWER_RIGHT
public static final HexDirection DOWN
public static final HexDirection LOWER_LEFT
public static final HexDirection UPPER_LEFT
Method Detail |
---|
public static HexDirection[] values()
for (HexDirection c : HexDirection.values()) System.out.println(c);
public static HexDirection valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static HexDirection fromString(String str)
str
- toString representation of this enum
IllegalArgumentException
- if argument is not represented by this enum.public static HexDirection random()
public HexDirection clockwise()
Orientation
clockwise
in interface Orientation
public HexDirection counterClockwise()
Orientation
counterClockwise
in interface Orientation
public HexDirection reverse()
Orientation
reverse
in interface Orientation
public Point getOffset(Point loc)
Orientation
getOffset
in interface Orientation
loc
- location to be offset
public boolean isUpper()
public String toString()
toString
in class Enum<HexDirection>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |