Package one.microstream.math
Enum DirectionCardinal
- All Implemented Interfaces:
Serializable
,Comparable<DirectionCardinal>
,java.lang.constant.Constable
public enum DirectionCardinal extends Enum<DirectionCardinal>
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTER
EAST
NORTH
NORTH_EAST
NORTH_WEST
SOUTH
SOUTH_EAST
SOUTH_WEST
WEST
-
Method Summary
Modifier and Type Method 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.
-
Enum Constant Details
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
translateNeighborVector
public static final DirectionCardinal translateNeighborVector(int difX, int difY) throws IllegalArgumentException- Parameters:
difX
- a value in { - 1, 0, +1}difY
- a value in { - 1, 0, +1}- Returns:
- the direction
difX
ordifY
represent ornull
otherweise. - Throws:
IllegalArgumentException
- if(difX, difY)
does not point to a neighbor square
-
getBit
public int getBit() -
opposite
-
isSet
public final boolean isSet(int bits) -
isMainDirection
public final boolean isMainDirection() -
isIntermediateDirection
public final boolean isIntermediateDirection()
-