Enum CompassPoint

java.lang.Object
java.lang.Enum<CompassPoint>
io.guise.framework.geometry.CompassPoint
All Implemented Interfaces:
Serializable, Comparable<CompassPoint>

public enum CompassPoint extends Enum<CompassPoint>
Navigational directions.
Author:
Garret Wilson
See Also:
  • Enum Constant Details

    • NORTH

      public static final CompassPoint NORTH
      N
    • NORTH_BY_EAST

      public static final CompassPoint NORTH_BY_EAST
      NbE
    • NORTH_NORTHEAST

      public static final CompassPoint NORTH_NORTHEAST
      NNE
    • NORTHEAST_BY_NORTH

      public static final CompassPoint NORTHEAST_BY_NORTH
      NEbN
    • NORTHEAST

      public static final CompassPoint NORTHEAST
      NE
    • NORTHEAST_BY_EAST

      public static final CompassPoint NORTHEAST_BY_EAST
      NEbE
    • EAST_NORTHEAST

      public static final CompassPoint EAST_NORTHEAST
      ENE
    • EAST_BY_NORTH

      public static final CompassPoint EAST_BY_NORTH
      EbN
    • EAST

      public static final CompassPoint EAST
      E
    • EAST_BY_SOUTH

      public static final CompassPoint EAST_BY_SOUTH
      EbS
    • EAST_SOUTHEAST

      public static final CompassPoint EAST_SOUTHEAST
      ESE
    • SOUTHEAST_BY_EAST

      public static final CompassPoint SOUTHEAST_BY_EAST
      SEbE
    • SOUTHEAST

      public static final CompassPoint SOUTHEAST
      SE
    • SOUTHEAST_BY_SOUTH

      public static final CompassPoint SOUTHEAST_BY_SOUTH
      SEbS
    • SOUTH_SOUTHEAST

      public static final CompassPoint SOUTH_SOUTHEAST
      SSE
    • SOUTH_BY_EAST

      public static final CompassPoint SOUTH_BY_EAST
      SbE
    • SOUTH

      public static final CompassPoint SOUTH
      S
    • SOUTH_BY_WEST

      public static final CompassPoint SOUTH_BY_WEST
      SbW
    • SOUTH_SOUTHWEST

      public static final CompassPoint SOUTH_SOUTHWEST
      SSW
    • SOUTHWEST_BY_SOUTH

      public static final CompassPoint SOUTHWEST_BY_SOUTH
      SWbS
    • SOUTHWEST

      public static final CompassPoint SOUTHWEST
      SW
    • SOUTHWEST_BY_WEST

      public static final CompassPoint SOUTHWEST_BY_WEST
      SWbW
    • WEST_SOUTHWEST

      public static final CompassPoint WEST_SOUTHWEST
      WSW
    • WEST_BY_SOUTH

      public static final CompassPoint WEST_BY_SOUTH
      WbS
    • WEST

      public static final CompassPoint WEST
      W
    • WEST_BY_NORTH

      public static final CompassPoint WEST_BY_NORTH
      WbN
    • WEST_NORTHWEST

      public static final CompassPoint WEST_NORTHWEST
      WNW
    • NORTHWEST_BY_WEST

      public static final CompassPoint NORTHWEST_BY_WEST
      NWbW
    • NORTHWEST

      public static final CompassPoint NORTHWEST
      NW
    • NORTHWEST_BY_NORTH

      public static final CompassPoint NORTHWEST_BY_NORTH
      NWbN
    • NORTH_NORTHWEST

      public static final CompassPoint NORTH_NORTHWEST
      NNW
    • NORTHBY_WEST

      public static final CompassPoint NORTHBY_WEST
      NbW
  • Field Details

    • MAX_BEARING

      public static final BigDecimal MAX_BEARING
      The maximum bearing available; synonymous with NORTH.
  • Method Details

    • values

      public static CompassPoint[] 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

      public static CompassPoint valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getAbbreviation

      public String getAbbreviation()
      Returns:
      The abbreviation of this compass point.
    • getBearing

      public BigDecimal 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

      public static CompassPoint getCompassPoint(BigDecimal bearing)
      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; either WEST or EAST.
      longitudeCompassPoint - The cardinal compass point of the longitude; either NORTH or SOUTH.
      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 is null.
      IllegalArgumentException - if the given latitude compass point is not WEST or EAST; and/or if the given longitude compass point is not NORTH or SOUTH.
    • checkBearing

      public static BigDecimal checkBearing(BigDecimal bearing)
      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.