Boeing Simulation 3.1 API Specification

objects
Class Location

java.lang.Object
  |
  +--objects.Point
        |
        +--objects.Location
All Implemented Interfaces:
Locatable, Serializable

public class Location
extends Point
implements Locatable

This class extends Point to provide for more distance applications. It also does checking to ensure that the Location is on the unit square.

Version:
$Revision: 1.10 $
Author:
Dave Jurgens
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class objects.Point
x, y
 
Constructor Summary
Location(double x, double y)
           
 
Method Summary
protected static double boundCheck(double d)
          Throws error if value is not on the unit square.
 boolean equals(Object o)
           
 double getDistance(objects.Locatable other)
          Returns the distance on the unit square between this and loc.
 objects.Location getLoc()
          Returns the Location of this Locatable.
 int hashCode()
          Returns the hash code of this object.
 boolean isEastOf(objects.Locatable other)
          Returns whether this Locatable is south of loc.
 boolean isNorthOf(objects.Locatable other)
          Returns whether this Locatable is north of loc.
 boolean isSouthOf(objects.Locatable other)
          Returns whether this Locatable is east of loc.
 boolean isWestOf(objects.Locatable other)
          Returns whether this Locatable is west of loc.
 String toString()
           
 
Methods inherited from class objects.Point
getX, getY
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

Location

public Location(double x,
                double y)
Method Detail

boundCheck

protected static double boundCheck(double d)
Throws error if value is not on the unit square.


getLoc

public objects.Location getLoc()
Description copied from interface: Locatable
Returns the Location of this Locatable.

Specified by:
getLoc in interface Locatable

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getDistance

public double getDistance(objects.Locatable other)
Description copied from interface: Locatable
Returns the distance on the unit square between this and loc.

Specified by:
getDistance in interface Locatable

hashCode

public int hashCode()
Returns the hash code of this object. Note that this implementation will return the same hash code for two different locations if their x and y coordinates differ by less than the millionth siginficant digit.

Overrides:
hashCode in class Object

isEastOf

public boolean isEastOf(objects.Locatable other)
Description copied from interface: Locatable
Returns whether this Locatable is south of loc.

Specified by:
isEastOf in interface Locatable

isNorthOf

public boolean isNorthOf(objects.Locatable other)
Description copied from interface: Locatable
Returns whether this Locatable is north of loc.

Specified by:
isNorthOf in interface Locatable

isSouthOf

public boolean isSouthOf(objects.Locatable other)
Description copied from interface: Locatable
Returns whether this Locatable is east of loc.

Specified by:
isSouthOf in interface Locatable

isWestOf

public boolean isWestOf(objects.Locatable other)
Description copied from interface: Locatable
Returns whether this Locatable is west of loc.

Specified by:
isWestOf in interface Locatable

toString

public String toString()
Overrides:
toString in class Object

Boeing Simulation 3.1 API Specification

To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.