org.geotools.geometry.coordinatesequence
Class DefaultCSBuilder

java.lang.Object
  extended byorg.geotools.geometry.coordinatesequence.DefaultCSBuilder
All Implemented Interfaces:
CSBuilder

public class DefaultCSBuilder
extends java.lang.Object
implements CSBuilder

CSBuilder that generates DefaultCoordinateSequence objects, that is, coordinate sequences backed by Coordinate[]

Author:
wolf

Constructor Summary
DefaultCSBuilder()
           
 
Method Summary
 com.vividsolutions.jts.geom.CoordinateSequence end()
          Stops the coordinate sequence building and returns the result
 int getDimension()
          Returns the dimension of the coordinate sequence we are building, -1 if there is none
 double getOrdinate(int ordinateIndex, int coordinateIndex)
          Gets an ordinate in the specified coordinate
 int getSize()
          Returns the size of the coordinate sequence we are building, -1 if there is none
 void setOrdinate(com.vividsolutions.jts.geom.CoordinateSequence sequence, double value, int ordinateIndex, int coordinateIndex)
          Utility method that allows to set an ordinate in an already built coordinate sequence Needed because the CoordinateSequence interface does not expose it
 void setOrdinate(double value, int ordinateIndex, int coordinateIndex)
          Sets and ordinate in the specified coordinate
 void start(int size, int dimensions)
          Starts the building of a new coordinate sequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCSBuilder

public DefaultCSBuilder()
Method Detail

start

public void start(int size,
                  int dimensions)
Description copied from interface: CSBuilder
Starts the building of a new coordinate sequence

Specified by:
start in interface CSBuilder
Parameters:
size - - the number of coordinates in the coordinate sequence
dimensions - - the dimension of the coordinates in the coordinate sequence, may be ignored if the coordinate sequence does not support variabile dimensions
See Also:
CSBuilder.start(int, int)

end

public com.vividsolutions.jts.geom.CoordinateSequence end()
Description copied from interface: CSBuilder
Stops the coordinate sequence building and returns the result

Specified by:
end in interface CSBuilder
Returns:
See Also:
org.geotools.geometry.coordinatesequence.CSBuilder#getCoordinateSequence()

setOrdinate

public void setOrdinate(double value,
                        int ordinateIndex,
                        int coordinateIndex)
Description copied from interface: CSBuilder
Sets and ordinate in the specified coordinate

Specified by:
setOrdinate in interface CSBuilder
Parameters:
value -
ordinateIndex -
coordinateIndex -
See Also:
CSBuilder.setOrdinate(double, int, int)

getOrdinate

public double getOrdinate(int ordinateIndex,
                          int coordinateIndex)
Description copied from interface: CSBuilder
Gets an ordinate in the specified coordinate

Specified by:
getOrdinate in interface CSBuilder
Parameters:
ordinateIndex -
coordinateIndex -
See Also:
CSBuilder.getOrdinate(int, int)

getSize

public int getSize()
Description copied from interface: CSBuilder
Returns the size of the coordinate sequence we are building, -1 if there is none

Specified by:
getSize in interface CSBuilder
Returns:
See Also:
CSBuilder.getSize()

getDimension

public int getDimension()
Description copied from interface: CSBuilder
Returns the dimension of the coordinate sequence we are building, -1 if there is none

Specified by:
getDimension in interface CSBuilder
Returns:
See Also:
CSBuilder.getDimension()

setOrdinate

public void setOrdinate(com.vividsolutions.jts.geom.CoordinateSequence sequence,
                        double value,
                        int ordinateIndex,
                        int coordinateIndex)
Description copied from interface: CSBuilder
Utility method that allows to set an ordinate in an already built coordinate sequence Needed because the CoordinateSequence interface does not expose it

Specified by:
setOrdinate in interface CSBuilder
Parameters:
sequence -
value -
ordinateIndex -
coordinateIndex -
See Also:
CSBuilder.setOrdinate(com.vividsolutions.jts.geom.CoordinateSequence, double, int, int)


Copyright © GeoTools. All Rights Reserved.