coordinates.area
Class Area

java.lang.Object
  extended bycoordinates.area.Area
All Implemented Interfaces:
java.lang.Cloneable

public abstract class Area
extends java.lang.Object
implements java.lang.Cloneable

The abstract class for an area in the three dimensional room. Provides a factory method to create new area objects.


Field Summary
protected  WGS84 origin
           
 
Constructor Summary
Area()
           
 
Method Summary
 java.lang.Object clone()
          The clone function.
abstract  boolean contains(Cartesian point)
          check if the given vector lies within this area.
abstract  boolean contains(WGS84 point)
          check if this area contains the given point.
abstract  void expand(Area area)
          expand the area to additionally cover the given room.
 WGS84 getOrigin()
           
abstract  long getVolume()
          get the volume of the area.
abstract  Area intersect(Area with)
          intersect two areas.
abstract  boolean isEmpty()
          check if the area does not cover any room.
abstract  boolean isSubsetOf(Area area)
          check if this area is a subset of the given one.
abstract  boolean isSupersetOf(Area area)
          check if this area is a superset of the given one.
abstract  java.util.Iterator iterator()
          return an iterator over the area.
abstract  void move(WGS84 newOrigin)
          move the origin of the area.
static Area newArea(WGS84 origin, java.util.Vector params)
          factory for new area objects.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

protected WGS84 origin
Constructor Detail

Area

public Area()
Method Detail

newArea

public static Area newArea(WGS84 origin,
                           java.util.Vector params)
factory for new area objects.

Parameters:
origin - the origin of the area
params - a Vector of params. They are interpreted by the constructor of the concrete area class. Usually this are the corners given in Cartesian coordinates.

getOrigin

public WGS84 getOrigin()
Returns:
the origin of the area in WGS84 coordinates

clone

public java.lang.Object clone()
The clone function. Java sucks. I will never understand why ones needs this if one only wants to have a bitwise copy. Especially the try clause is pain in the a..


iterator

public abstract java.util.Iterator iterator()
return an iterator over the area. The iterator returns cartesian coordinates. For performance reasons always the same object is returned whith new values. So do not memory any references on it


move

public abstract void move(WGS84 newOrigin)
move the origin of the area. The absolut covered area stays the same, so basically the corners are recalculated


expand

public abstract void expand(Area area)
expand the area to additionally cover the given room. The area should stay as small as possible but there may exist a room afterwards which didn't belong to either area before.


intersect

public abstract Area intersect(Area with)
intersect two areas. The returned area has the same origin as this object.

Returns:
the intersection area

getVolume

public abstract long getVolume()
get the volume of the area.

Returns:
the volume of the area in grid units ^ 3

isEmpty

public abstract boolean isEmpty()
check if the area does not cover any room.

Returns:
true if the area is empty, false otherwise.

isSubsetOf

public abstract boolean isSubsetOf(Area area)
check if this area is a subset of the given one.

Returns:
true if it is, false otherwise

isSupersetOf

public abstract boolean isSupersetOf(Area area)
check if this area is a superset of the given one.

Returns:
true if it is, false otherwise

contains

public abstract boolean contains(WGS84 point)
check if this area contains the given point.

Returns:
true if it does, false otherwise

contains

public abstract boolean contains(Cartesian point)
check if the given vector lies within this area.

Returns:
true if it does, flase otherwise