Package io.guise.framework.geometry
Enum CompassPoint
- All Implemented Interfaces:
Serializable
,Comparable<CompassPoint>
Navigational directions.
- Author:
- Garret Wilson
- See Also:
-
Enum Constant Summary
Enum ConstantDescriptionEEbNEbSENEESENNbENNENNWNbWNENEbENEbNNWNWbNNWbWSSbESbWSSESSWSESEbESEbSSWSWbSSWbWWWbNWbSWNWWSW -
Field Summary
Modifier and TypeFieldDescriptionstatic final BigDecimal
The maximum bearing available; synonymous withNORTH
. -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
checkBearing
(BigDecimal bearing) Checks to ensure that the given bearing is valid.static CompassPoint
getCompassPoint
(BigDecimal bearing) Determines the closes compass point to the given bearing.static CompassPoint
getOrdinalCompassPoint
(CompassPoint latitudeCompassPoint, CompassPoint longitudeCompassPoint) Returns the ordinal or inter-cardinal compass point corresponding to 45 degrees between the given cardinal latitude and longitude compass points.boolean
boolean
static CompassPoint
Returns the enum constant of this type with the specified name.static CompassPoint[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NORTH
N -
NORTH_BY_EAST
NbE -
NORTH_NORTHEAST
NNE -
NORTHEAST_BY_NORTH
NEbN -
NORTHEAST
NE -
NORTHEAST_BY_EAST
NEbE -
EAST_NORTHEAST
ENE -
EAST_BY_NORTH
EbN -
EAST
E -
EAST_BY_SOUTH
EbS -
EAST_SOUTHEAST
ESE -
SOUTHEAST_BY_EAST
SEbE -
SOUTHEAST
SE -
SOUTHEAST_BY_SOUTH
SEbS -
SOUTH_SOUTHEAST
SSE -
SOUTH_BY_EAST
SbE -
SOUTH
S -
SOUTH_BY_WEST
SbW -
SOUTH_SOUTHWEST
SSW -
SOUTHWEST_BY_SOUTH
SWbS -
SOUTHWEST
SW -
SOUTHWEST_BY_WEST
SWbW -
WEST_SOUTHWEST
WSW -
WEST_BY_SOUTH
WbS -
WEST
W -
WEST_BY_NORTH
WbN -
WEST_NORTHWEST
WNW -
NORTHWEST_BY_WEST
NWbW -
NORTHWEST
NW -
NORTHWEST_BY_NORTH
NWbN -
NORTH_NORTHWEST
NNW -
NORTHBY_WEST
NbW
-
-
Field Details
-
MAX_BEARING
The maximum bearing available; synonymous withNORTH
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getAbbreviation
- Returns:
- The abbreviation of this compass point.
-
getBearing
- Returns:
- The compass direction.
-
isCardinal
public boolean isCardinal()- Returns:
- Whether this compass point represents one of the four cardinal directions.
-
isOrdinal
public boolean isOrdinal()- Returns:
- Whether this compass point represents one of the four ordinal or intercardinal directions.
-
getCompassPoint
Determines the closes compass point to the given bearing.- Parameters:
bearing
- The bearing for which a compass point should be returned.- Returns:
- The compass point closest to the given bearing.
- Throws:
IllegalArgumentException
- if the given bearing is greater than 360.
-
getOrdinalCompassPoint
public static CompassPoint getOrdinalCompassPoint(CompassPoint latitudeCompassPoint, CompassPoint longitudeCompassPoint) Returns the ordinal or inter-cardinal compass point corresponding to 45 degrees between the given cardinal latitude and longitude compass points.- Parameters:
latitudeCompassPoint
- The cardinal compass point of the latitude; eitherWEST
orEAST
.longitudeCompassPoint
- The cardinal compass point of the longitude; eitherNORTH
orSOUTH
.- Returns:
- The ordinal compass position corresponding to 45 degrees between the given cardinal longitude and latitude compass points.
- Throws:
NullPointerException
- if the given latitude and/or longitude compass point isnull
.IllegalArgumentException
- if the given latitude compass point is notWEST
orEAST
; and/or if the given longitude compass point is notNORTH
orSOUTH
.
-
checkBearing
Checks to ensure that the given bearing is valid.- Parameters:
bearing
- The bearing to check.- Returns:
- The valid bearing.
- Throws:
IllegalArgumentException
- if the given bearing is greater than 360.
-