Package one.microstream.math
Enum DirectionCardinal
- java.lang.Object
-
- java.lang.Enum<DirectionCardinal>
-
- one.microstream.math.DirectionCardinal
-
- All Implemented Interfaces:
Serializable
,Comparable<DirectionCardinal>
,java.lang.constant.Constable
public enum DirectionCardinal extends Enum<DirectionCardinal>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
-
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 Detail
-
NORTH_WEST
public static final DirectionCardinal NORTH_WEST
-
NORTH
public static final DirectionCardinal NORTH
-
NORTH_EAST
public static final DirectionCardinal NORTH_EAST
-
WEST
public static final DirectionCardinal WEST
-
CENTER
public static final DirectionCardinal CENTER
-
EAST
public static final DirectionCardinal EAST
-
SOUTH_WEST
public static final DirectionCardinal SOUTH_WEST
-
SOUTH
public static final DirectionCardinal SOUTH
-
SOUTH_EAST
public static final DirectionCardinal SOUTH_EAST
-
-
Method Detail
-
values
public static DirectionCardinal[] 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
public static DirectionCardinal 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
-
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
public DirectionCardinal opposite()
-
isSet
public final boolean isSet(int bits)
-
isMainDirection
public final boolean isMainDirection()
-
isIntermediateDirection
public final boolean isIntermediateDirection()
-
-