Spatial DataBlade
JAVA API v8.21

com.ibm.spatial.geom
Class CoordPoint

java.lang.Object
  extended by com.ibm.spatial.geom.CoordPoint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
CoordPoint.Double, CoordPoint.Long

public abstract class CoordPoint
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

CoordPoint is a helper class that represents a coordinate point. Unlike a geometry Point that contains spatial reference system information, a coordinate point only contains coordinate values and methods to access them.

This class is only the abstract superclass for all objects that store a CoordPoint. The actual storage representation is left to the subclass.

See Also:
Serialized Form

Nested Class Summary
static class CoordPoint.Double
          The Double class defines a 2D CoordPoint specified in double precision coordinates.
static class CoordPoint.DoubleZM
          The CoordPoint.DoubleZM class defines a CoordPoint specified in double precision coordinates.
static class CoordPoint.Long
          The Long class defines a 2D CoordPoint specified in integer coordinates.
static class CoordPoint.LongZM
          The LongZM class defines a CoordPoint specified in integer coordinates.
 
Method Summary
 java.lang.Object clone()
          Return a copy of this object.
 boolean equals(java.lang.Object obj)
          Determines whether or not the specified Object is equal to this CoordPoint.
 boolean equals(java.lang.Object obj, double xyEpsilon, double zEpsilon, double mEpsilon)
          Determines whether or not the specified Object is equal to this CoordPoint within precision limits specified by xyEpsilon, zEpsilon, mEpsilon).
 double getCoordAt(int n)
          Gets the coordinate specified by index n, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.
abstract  double getM()
          Returns the measure associated to this CoordPoint.
abstract  double getX()
          Returns the X coordinate of this CoordPoint.
abstract  double getY()
          Returns the Y coordinate of this CoordPoint.
abstract  double getZ()
          Returns the Z coordinate of this CoordPoint.
 int hashCode()
          Returns the hashcode for this CoordPoint.
 boolean hasM()
          Determines whether or not this CoordPoint has a measure.
 boolean hasZ()
          Determines whether or not this CoordPoint has a Z coordinate.
abstract  boolean isEmpty()
          Tests whether this CoordPoint is empty.
 void setCoord(CoordPoint point)
          Sets the coordinates of this CoordPoint to the values specified by the argument.
abstract  void setCoord(double x, double y)
          Sets the coordinates of this CoordPoint to the specified values.
abstract  void setCoordAt(int n, double value)
          Sets the coordinate specified by index n with the value specified by value, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.
abstract  void setEmpty()
          Sets this CoordPoint to be empty.
 void setM(double m)
          Sets the measure of this CoordPoint to the specified value.
 void setZ(double z)
          Sets the coordinates of this CoordPoint to the specified values.
 java.lang.String toString()
          Returns the String representation of this CoordPoint.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getCoordAt

public double getCoordAt(int n)
Gets the coordinate specified by index n, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.

Parameters:
n - the measure value
Returns:
the n-th coordinate value
Throws:
java.lang.IndexOutOfBoundsException - id n < 0 or n > 3

getX

public abstract double getX()
Returns the X coordinate of this CoordPoint.

Returns:
the X coordinate of this CoordPoint in double precision.

getY

public abstract double getY()
Returns the Y coordinate of this CoordPoint.

Returns:
the Y coordinate of this CoordPoint in double precision.

getZ

public abstract double getZ()
Returns the Z coordinate of this CoordPoint.

Returns:
the Z coordinate of this CoordPoint in double precision.

getM

public abstract double getM()
Returns the measure associated to this CoordPoint.

Returns:
the measure of this CoordPoint in double precision.

setCoordAt

public abstract void setCoordAt(int n,
                                double value)
Sets the coordinate specified by index n with the value specified by value, where n=0 corresponds to x, n=1 to y, n=2 to z, and n=3 to m.

Parameters:
n - the measure value

setCoord

public void setCoord(CoordPoint point)
Sets the coordinates of this CoordPoint to the values specified by the argument.

Parameters:
point - the point whose coordinate values are copied to this object

setCoord

public abstract void setCoord(double x,
                              double y)
Sets the coordinates of this CoordPoint to the specified values.

Parameters:
x - the x coordinate value
y - the y coordinate value

setZ

public void setZ(double z)
Sets the coordinates of this CoordPoint to the specified values.

This implementation ignores the argument value.

Parameters:
z - the z coordinate value

setM

public void setM(double m)
Sets the measure of this CoordPoint to the specified value.

This implementation ignores the argument value.

Parameters:
m - the measure value

setEmpty

public abstract void setEmpty()
Sets this CoordPoint to be empty.


isEmpty

public abstract boolean isEmpty()
Tests whether this CoordPoint is empty.

Returns:
true if this point is empty; otherwise, returns false

hasZ

public boolean hasZ()
Determines whether or not this CoordPoint has a Z coordinate.

Returns:
true if this CoordPoint has a Z coordinate; false otherwise.

hasM

public boolean hasM()
Determines whether or not this CoordPoint has a measure.

Returns:
true if this CoordPoint has a measure; false otherwise.

toString

public java.lang.String toString()
Returns the String representation of this CoordPoint.

Overrides:
toString in class java.lang.Object
Returns:
a String representing this CoordPoint.

hashCode

public int hashCode()
Returns the hashcode for this CoordPoint.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode for this CoordPoint.

equals

public boolean equals(java.lang.Object obj)
Determines whether or not the specified Object is equal to this CoordPoint. The specified Object is equal to this CoordPoint if it is an instance of CoordPoint and if its location and size are the same as this CoordPoint.

Overrides:
equals in class java.lang.Object
Parameters:
obj - an Object to be compared with this CoordPoint.
Returns:
true if obj is an instance of CoordPoint and has the same values; false otherwise.

equals

public boolean equals(java.lang.Object obj,
                      double xyEpsilon,
                      double zEpsilon,
                      double mEpsilon)
Determines whether or not the specified Object is equal to this CoordPoint within precision limits specified by xyEpsilon, zEpsilon, mEpsilon). The specified Object is equal to this CoordPoint if it is an instance of CoordPoint and if its x,y,z,m coordinates are different from the coordinates of this object with less than xyEpsilon, zEpsilon, mEpsilon, respectively.

Parameters:
xyEpsilon - the difference accepted between the x (or y) coordinates of the objects tested for equality.
zEpsilon - the difference accepted between the z coordinates of the objects tested for equality.
mEpsilon - the difference accepted between the m coordinates (measures) of the objects tested for equality.
Returns:
true if obj is an instance of CoordPoint and has similar values; false otherwise.

clone

public java.lang.Object clone()
Return a copy of this object.

Overrides:
clone in class java.lang.Object

Spatial DataBlade
JAVA API v8.21


Licensed Materials - Property of IBM
Copyright IBM Corp. 2002, 2012 All Rights Reserved.