Enum Class Compass
- All Implemented Interfaces:
Serializable,Comparable<Compass>,Constable
Rough direction of the four main cardinal points /
Grobe Himmelsrichtung der vier Haupthimmelsrichtungen
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic CompassfromNumber(int number) Konvertiere eine Himmelrichtungsnummer in den Aufzählungstyp.intReturns the number associated with the cardinal point (0: EAST, 1: SOUTH, 2: WEST; 3: NORTH).rotate(int diff) static DirectiontoDirection(Compass compass) Konvertiere eine Himmelrichtungsnummer in den Aufzählungstyp.static CompassReturns the enum constant of this class with the specified name.static Compass[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EAST
-
SOUTH
-
WEST
-
NORTH
-
-
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
-
getNumber
public int getNumber()Returns the number associated with the cardinal point (0: EAST, 1: SOUTH, 2: WEST; 3: NORTH).- Returns:
- the number associated with the cardinal point
-
fromNumber
Konvertiere eine Himmelrichtungsnummer in den Aufzählungstyp. -
rotate
- Parameters:
diff- Positive Werte im Uhrzeigersinn.
-