Enum Class AxisOrder
- All Implemented Interfaces:
Serializable,Comparable<AxisOrder>,Constable,Comparator<Position>
@AvailableSince("0.0.46")
public enum AxisOrder
extends Enum<AxisOrder>
implements Comparator<Position>
Represents the order of axes in 3D space and provides utilities for working with positions and dimensions
according to the specified axis order. Implements
Comparator for comparing Position objects
based on the axis order.
Each enum constant defines a unique permutation of the axes (X, Y, Z).
- XYZ: X, then Y, then Z
- XZY: X, then Z, then Y
- YXZ: Y, then X, then Z
- YZX: Y, then Z, then X
- ZXY: Z, then X, then Y
- ZYX: Z, then Y, then X
Provides methods for retrieving axes, creating positions and dimensions, iterating over positions, and comparing positions according to the axis order.
- Since:
- 0.0.46
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionareaSize(int i0, int i1, int i2) Creates an AreaSize object using the specified values for each axis according to this order.static AxisOrderbyId(byte id) Returns the AxisOrder constant by its id.intCompares two positions according to this axis order.getAxes()Returns the list of axes in this order.getFirst()Returns the first axis in this order.bytegetId()Returns the id of this AxisOrder.Returns the second axis in this order.getThird()Returns the third axis in this order.Returns an iterator over positions between pos0 and pos1 with the given step, following this axis order.position(int i0, int i1, int i2) Creates a Position object using the specified values for each axis according to this order.static AxisOrderReturns the enum constant of this class with the specified name.static AxisOrder[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Enum Constant Details
-
XYZ
X, then Y, then Z -
XZY
X, then Z, then Y -
YXZ
Y, then X, then Z -
YZX
Y, then Z, then X -
ZXY
Z, then X, then Y -
ZYX
Z, then Y, then X
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
byId
Returns the AxisOrder constant by its id.- Parameters:
id- the id of the AxisOrder- Returns:
- the AxisOrder for the given id
- Throws:
IndexOutOfBoundsException- if the id is out of bounds
-
getId
public byte getId()Returns the id of this AxisOrder.- Returns:
- the id
-
getAxes
Returns the list of axes in this order.- Returns:
- the axes
-
iterator
Returns an iterator over positions between pos0 and pos1 with the given step, following this axis order.- Parameters:
pos0- the starting positionpos1- the ending positionstep- the step size- Returns:
- an iterator over positions
-
getFirst
Returns the first axis in this order.- Returns:
- the first axis
-
getSecond
Returns the second axis in this order.- Returns:
- the second axis
-
getThird
Returns the third axis in this order.- Returns:
- the third axis
-
position
Creates a Position object using the specified values for each axis according to this order.- Parameters:
i0- value for the first axisi1- value for the second axisi2- value for the third axis- Returns:
- a Position object
-
areaSize
Creates an AreaSize object using the specified values for each axis according to this order.- Parameters:
i0- value for the first axisi1- value for the second axisi2- value for the third axis- Returns:
- an AreaSize object
-
compare
Compares two positions according to this axis order.- Specified by:
comparein interfaceComparator<Position>- Parameters:
position- the first positionother- the second position- Returns:
- a negative integer, zero, or a positive integer as the first position is less than, equal to, or greater than the second
-