public enum Compass extends java.lang.Enum<Compass>
NORTH
and continuing clockwise in 45 degree increments.Enum Constant and Description |
---|
EAST
Specifies 90 degrees.
|
NORTH
Specifies zero degrees.
|
NORTH_EAST
Specifies 45 degrees.
|
NORTH_WEST
Specifies 315 degrees.
|
SOUTH
Specifies 180 degrees.
|
SOUTH_EAST
Specifies 135 degrees.
|
SOUTH_WEST
Specifies 225 degrees.
|
WEST
Specifies 270 degrees.
|
Modifier and Type | Method and Description |
---|---|
int |
degrees()
Gets the angle associated with the
Compass point. |
static Compass |
fromDegrees(int degrees)
Gets the
Compass point at the specified angle. |
static Compass |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Compass[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Compass NORTH
public static final Compass NORTH_EAST
public static final Compass EAST
public static final Compass SOUTH_EAST
public static final Compass SOUTH
public static final Compass SOUTH_WEST
public static final Compass WEST
public static final Compass NORTH_WEST
public static Compass[] values()
for (Compass c : Compass.values()) System.out.println(c);
public static Compass valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int degrees()
Compass
point.public static Compass fromDegrees(int degrees)