- All Implemented Interfaces:
Serializable
,Comparable<Rotation>
,Constable
,FriendlyNamed
Enum to model a page rotation.
- Author:
- Andrea Vacondio
-
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 TypeMethodDescriptionaddRotation
(Rotation rotation) int
static Rotation
getRotation
(int degrees) static Rotation
Returns the enum constant of this class with the specified name.static Rotation[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEGREES_0
-
DEGREES_90
-
DEGREES_180
-
DEGREES_270
-
-
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
-
getFriendlyName
- Specified by:
getFriendlyName
in interfaceFriendlyNamed
- Returns:
- the friendly name of the entity, to be usually used as a representation for an user.
-
getDegrees
public int getDegrees()- Returns:
- the degrees
-
getRotation
- Parameters:
degrees
- rotation degrees- Returns:
- the rotation corresponding to the input degrees module 360. Only multiple of 90 degrees are recognized as valid rotations otherwise a zero degrees rotation is returned.
-
addRotation
- Parameters:
rotation
-- Returns:
- the rotation obtained adding the input rotation to the current rotation.
-
rotateClockwise
- Returns:
- a clockwise rotation
-
rotateAnticlockwise
- Returns:
- an anti clockwise rotation
-