public enum Rotation extends Enum<Rotation>
VonNeumannNeighbourhood
or
MooreNeighbourhood
element by calling its
Neighbourhood.next(Rotation)
method.Enum Constant and Description |
---|
ANTI_CLOCKWISE
Represents an anti-clockwise rotation.
|
CLOCKWISE
Represents a clockwise rotation.
|
Modifier and Type | Method and Description |
---|---|
Rotation |
inverse()
Inverts the rotation direction.
|
<N extends Neighbourhood<N>> |
next(N aNeighbourhood)
Returns the next neighbourhood relative to the provided neighbourhood.
|
static Rotation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Rotation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Rotation CLOCKWISE
public static final Rotation ANTI_CLOCKWISE
public static Rotation[] values()
for (Rotation c : Rotation.values()) System.out.println(c);
public static Rotation 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 Rotation inverse()
CLOCKWISE
rotation becomes an
ANTI_CLOCKWISE
rotation and vice versa.public <N extends Neighbourhood<N>> N next(N aNeighbourhood)
Rotation
state, either
Neighbourhood.clockwiseNext()
CLOCKWISE
or
Neighbourhood.clockwisePrevious()
ANTI_CLOCKWISE
N
- The neighbourhood such as the VonNeumannNeighbourhood
or the MooreNeighbourhood
.aNeighbourhood
- The current state for which to retrieve the next
neighbourhood.Copyright © 2018. All rights reserved.