public enum DirectionCardinal extends Enum<DirectionCardinal>
Enum Constant and Description |
---|
CENTER |
EAST |
NORTH |
NORTH_EAST |
NORTH_WEST |
SOUTH |
SOUTH_EAST |
SOUTH_WEST |
WEST |
Modifier and Type | Method and Description |
---|---|
int |
getBit() |
boolean |
isIntermediateDirection() |
boolean |
isMainDirection() |
boolean |
isSet(int bits) |
DirectionCardinal |
opposite() |
static DirectionCardinal |
translateNeighborVector(int difX,
int difY) |
static DirectionCardinal |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DirectionCardinal[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DirectionCardinal NORTH_WEST
public static final DirectionCardinal NORTH
public static final DirectionCardinal NORTH_EAST
public static final DirectionCardinal WEST
public static final DirectionCardinal CENTER
public static final DirectionCardinal EAST
public static final DirectionCardinal SOUTH_WEST
public static final DirectionCardinal SOUTH
public static final DirectionCardinal SOUTH_EAST
public static DirectionCardinal[] values()
for (DirectionCardinal c : DirectionCardinal.values()) System.out.println(c);
public static DirectionCardinal 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 static final DirectionCardinal translateNeighborVector(int difX, int difY) throws IllegalArgumentException
difX
- a value in {-1, 0, +1}difY
- a value in {-1, 0, +1}difX
or difY
represent or null otherweise.IllegalArgumentException
- if (difX, difY)
does not point to a neighbor squarepublic int getBit()
public DirectionCardinal opposite()
public final boolean isSet(int bits)
public final boolean isMainDirection()
public final boolean isIntermediateDirection()
Copyright © 2003–2022 XDEV Software. All rights reserved.