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 CENTEREASTNORTHNORTH_EASTNORTH_WESTSOUTHSOUTH_EASTSOUTH_WESTWEST -
Method Summary
Modifier and Type Method Description intgetBit()booleanisIntermediateDirection()booleanisMainDirection()booleanisSet(int bits)DirectionCardinalopposite()static DirectionCardinaltranslateNeighborVector(int difX, int difY)static DirectionCardinalvalueOf(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
difXordifYrepresent ornullotherweise. - 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()
-