geometry
Class Coordinates2D

java.lang.Object
  extended by geometry.Coordinates2D
All Implemented Interfaces:
Coordinates
Direct Known Subclasses:
Coordinates3D

public class Coordinates2D
extends java.lang.Object
implements Coordinates

Coordinates2D holds information about two-dimensional coordinates (x and y coordinate). access to the z-coordinate has to be provided, as interface demands this, but is always substituted by 0.


Field Summary
private  double x
          the x coordinate
private  double y
          the y coordinate
 
Constructor Summary
Coordinates2D(double x, double y)
          constructor.
 
Method Summary
 boolean equals(Coordinates coordinates)
          test if two coordinates are equal, that is, all of their components are equal.
 double getDistance(Coordinates coordinates)
          get the distance between two coordinates.
 double getX()
          get x coordinate
 double getY()
          get y coordinate
 double getZ()
          get z coordinate
 boolean isNeighbor(Coordinates coordinates)
          check if the coordinates specified by the parameter are neighbor coordinates.
 void setX(double x)
          set x coordinate
 void setY(double y)
          set y coordinate
 void setZ(double z)
          set z coordinate
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

private double x
the x coordinate


y

private double y
the y coordinate

Constructor Detail

Coordinates2D

public Coordinates2D(double x,
                     double y)
constructor. create a new 2D-coordinate with x and y coordinate given.

Parameters:
x -
y -
Method Detail

equals

public boolean equals(Coordinates coordinates)
Description copied from interface: Coordinates
test if two coordinates are equal, that is, all of their components are equal.

Specified by:
equals in interface Coordinates

getDistance

public double getDistance(Coordinates coordinates)
Description copied from interface: Coordinates
get the distance between two coordinates.

Specified by:
getDistance in interface Coordinates
Parameters:
coordinates - the coordinates to get the distance from
Returns:
the distance between this object's coordinates and the parameter

getX

public double getX()
Description copied from interface: Coordinates
get x coordinate

Specified by:
getX in interface Coordinates
Returns:
x

getY

public double getY()
Description copied from interface: Coordinates
get y coordinate

Specified by:
getY in interface Coordinates
Returns:
y

getZ

public double getZ()
Description copied from interface: Coordinates
get z coordinate

Specified by:
getZ in interface Coordinates
Returns:
z

setX

public void setX(double x)
Description copied from interface: Coordinates
set x coordinate

Specified by:
setX in interface Coordinates

setY

public void setY(double y)
Description copied from interface: Coordinates
set y coordinate

Specified by:
setY in interface Coordinates

setZ

public void setZ(double z)
Description copied from interface: Coordinates
set z coordinate

Specified by:
setZ in interface Coordinates

isNeighbor

public boolean isNeighbor(Coordinates coordinates)
Description copied from interface: Coordinates
check if the coordinates specified by the parameter are neighbor coordinates. Will work only for unit pixels/voxels, that is, when Coordinates == Index

Specified by:
isNeighbor in interface Coordinates
Parameters:
coordinates - the coordinates to check neighborhood to
Returns:
true if the two coordinates are directly adjacent, false if not.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object