org.hermit.geo
Class PointOfInterest

java.lang.Object
  extended by org.hermit.geo.PointOfInterest
Direct Known Subclasses:
PointOfInterest.BAND, PointOfInterest.LAT, PointOfInterest.LON, PointOfInterest.POS

public abstract class PointOfInterest
extends java.lang.Object

This class represents a point or area of interest. Its subclasses define specific interest zones, as either points, lines or areas.

Author:
Ian Cameron Smith

Nested Class Summary
static class PointOfInterest.BAND
          Class BAND represents an interesting band of latitudes.
static class PointOfInterest.LAT
          Class LAT represents an interesting line of latitude.
static class PointOfInterest.LON
          Class LON represents an interesting meridian, or a segment of a meridian.
static class PointOfInterest.POS
          Class POS represents an interesting position.
 
Field Summary
static PointOfInterest[] GLOBAL_AREAS
          List of regions of the world.
static PointOfInterest[] GLOBAL_POIS
          List of general global points of interest.
 
Constructor Summary
PointOfInterest(java.lang.String n)
          Create a Position from a latitude and longitude.
 
Method Summary
static java.lang.String describePoint(Position pos)
          Describe the status of the given position relative to global points of interest.
static java.lang.String describePosition(Position pos)
          Describe the status of the given position relative to global points of interest.
static java.lang.String describeRegion(Position pos)
          Describe the status of the given position in terms of any region of interest it lies within.
abstract  Distance distance(Position pos)
          Calculate the distance from the given position to this point of interest.
 java.lang.String getName()
          Get the name of this point of interest.
 java.lang.String status(Position pos)
          Describe the status of the given position relative to this point of interest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_POIS

public static final PointOfInterest[] GLOBAL_POIS
List of general global points of interest. The closest point here will be taken as our interesting point, if in there is one in the range specified by DISTANCE_NEAR.


GLOBAL_AREAS

public static final PointOfInterest[] GLOBAL_AREAS
List of regions of the world. Area is important in this list -- the first band we're in is the one returned. This is significant for overlapping bands (like the Antarctic and the Screaming Sixties).

Constructor Detail

PointOfInterest

public PointOfInterest(java.lang.String n)
Create a Position from a latitude and longitude.

Parameters:
n - Name of this point / area..
Method Detail

getName

public final java.lang.String getName()
Get the name of this point of interest.

Returns:
The name of this point.

distance

public abstract Distance distance(Position pos)
Calculate the distance from the given position to this point of interest.

Parameters:
pos - The position to calculate from.
Returns:
The distance from pos to here. Note: may be inaccurate over larger distances, e.g. for distance to a meridian.

status

public java.lang.String status(Position pos)
Describe the status of the given position relative to this point of interest.

Parameters:
pos - The position to describe.
Returns:
A string describing where pos is in relation to this POI.

describePosition

public static final java.lang.String describePosition(Position pos)
Describe the status of the given position relative to global points of interest.

Parameters:
pos - The position to describe.
Returns:
A string describing where pos is in relation to the nearest known global POI.

describeRegion

public static final java.lang.String describeRegion(Position pos)
Describe the status of the given position in terms of any region of interest it lies within.

Parameters:
pos - The position to describe.
Returns:
A string describing the region, if any, that pos is within. Null if we aren't in an interesting region.

describePoint

public static final java.lang.String describePoint(Position pos)
Describe the status of the given position relative to global points of interest.

Parameters:
pos - The position to describe.
Returns:
A string describing where pos is in relation to the nearest known global POI. Null if we aren't close to anywhere interesting.