org.hibernate.spatial.jts.mgeom
Class MCoordinateSequence

java.lang.Object
  extended by org.hibernate.spatial.jts.mgeom.MCoordinateSequence
All Implemented Interfaces:
com.vividsolutions.jts.geom.CoordinateSequence, java.io.Serializable, java.lang.Cloneable

public class MCoordinateSequence
extends java.lang.Object
implements com.vividsolutions.jts.geom.CoordinateSequence, java.io.Serializable

Implements the CoordinateSequence interface. In this implementation, Coordinates returned by #toArray and #get are live -- parties that change them are actually changing the MCoordinateSequence's underlying data.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.vividsolutions.jts.geom.CoordinateSequence
M, X, Y, Z
 
Constructor Summary
MCoordinateSequence(com.vividsolutions.jts.geom.Coordinate[] copyCoords)
          Constructor that makes a copy of an array of Coordinates.
MCoordinateSequence(com.vividsolutions.jts.geom.CoordinateSequence coordSeq)
          Constructor that makes a copy of a CoordinateSequence.
MCoordinateSequence(int size)
          Constructs a sequence of a given size, populated with new MCoordinates.
MCoordinateSequence(MCoordinate[] coordinates)
          Copy constructor -- simply aliases the input array, for better performance.
 
Method Summary
 java.lang.Object clone()
           
static MCoordinate[] copy(com.vividsolutions.jts.geom.Coordinate[] coordinates)
           
static MCoordinate[] copy(com.vividsolutions.jts.geom.CoordinateSequence coordSeq)
           
 com.vividsolutions.jts.geom.Envelope expandEnvelope(com.vividsolutions.jts.geom.Envelope env)
           
 com.vividsolutions.jts.geom.Coordinate getCoordinate(int i)
           
 void getCoordinate(int index, com.vividsolutions.jts.geom.Coordinate coord)
           
 com.vividsolutions.jts.geom.Coordinate getCoordinateCopy(int index)
           
 int getDimension()
           
 double getM(int index)
           
 double getOrdinate(int index, int ordinateIndex)
           
 double getX(int index)
           
 double getY(int index)
           
 void setOrdinate(int index, int ordinateIndex, double value)
           
 int size()
           
 com.vividsolutions.jts.geom.Coordinate[] toCoordinateArray()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MCoordinateSequence

public MCoordinateSequence(MCoordinate[] coordinates)
Copy constructor -- simply aliases the input array, for better performance.

Parameters:
coordinates -

MCoordinateSequence

public MCoordinateSequence(com.vividsolutions.jts.geom.Coordinate[] copyCoords)
Constructor that makes a copy of an array of Coordinates. Always makes a copy of the input array, since the actual class of the Coordinates in the input array may be different from MCoordinate.

Parameters:
copyCoords -

MCoordinateSequence

public MCoordinateSequence(com.vividsolutions.jts.geom.CoordinateSequence coordSeq)
Constructor that makes a copy of a CoordinateSequence.

Parameters:
coordSeq -

MCoordinateSequence

public MCoordinateSequence(int size)
Constructs a sequence of a given size, populated with new MCoordinates.

Parameters:
size - the size of the sequence to create
Method Detail

copy

public static MCoordinate[] copy(com.vividsolutions.jts.geom.Coordinate[] coordinates)

copy

public static MCoordinate[] copy(com.vividsolutions.jts.geom.CoordinateSequence coordSeq)

getDimension

public int getDimension()
Specified by:
getDimension in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.getDimension()

getCoordinate

public com.vividsolutions.jts.geom.Coordinate getCoordinate(int i)
Specified by:
getCoordinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinateCopy

public com.vividsolutions.jts.geom.Coordinate getCoordinateCopy(int index)
Specified by:
getCoordinateCopy in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.getCoordinateCopy(int)

getCoordinate

public void getCoordinate(int index,
                          com.vividsolutions.jts.geom.Coordinate coord)
Specified by:
getCoordinate in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.getCoordinate(int, com.vividsolutions.jts.geom.Coordinate)

getX

public double getX(int index)
Specified by:
getX in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.getX(int)

getY

public double getY(int index)
Specified by:
getY in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.getY(int)

getM

public double getM(int index)
Returns:
the measure value of the coordinate in the index

getOrdinate

public double getOrdinate(int index,
                          int ordinateIndex)
Specified by:
getOrdinate in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.getOrdinate(int, int)

setOrdinate

public void setOrdinate(int index,
                        int ordinateIndex,
                        double value)
Specified by:
setOrdinate in interface com.vividsolutions.jts.geom.CoordinateSequence
See Also:
CoordinateSequence.setOrdinate(int, int, double)

clone

public java.lang.Object clone()
Specified by:
clone in interface com.vividsolutions.jts.geom.CoordinateSequence
Overrides:
clone in class java.lang.Object

size

public int size()
Specified by:
size in interface com.vividsolutions.jts.geom.CoordinateSequence

toCoordinateArray

public com.vividsolutions.jts.geom.Coordinate[] toCoordinateArray()
Specified by:
toCoordinateArray in interface com.vividsolutions.jts.geom.CoordinateSequence

expandEnvelope

public com.vividsolutions.jts.geom.Envelope expandEnvelope(com.vividsolutions.jts.geom.Envelope env)
Specified by:
expandEnvelope in interface com.vividsolutions.jts.geom.CoordinateSequence

toString

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