Package org.meteoinfo.jts.geom.impl
Class PackedCoordinateSequenceFactory
- java.lang.Object
-
- org.meteoinfo.jts.geom.impl.PackedCoordinateSequenceFactory
-
- All Implemented Interfaces:
CoordinateSequenceFactory
public class PackedCoordinateSequenceFactory extends java.lang.Object implements CoordinateSequenceFactory
Builds packed array coordinate sequences. The array data type can be either double or float, and defaults to float.
-
-
Field Summary
Fields Modifier and Type Field Description static intDOUBLEstatic PackedCoordinateSequenceFactoryDOUBLE_FACTORYstatic intFLOATstatic PackedCoordinateSequenceFactoryFLOAT_FACTORY
-
Constructor Summary
Constructors Constructor Description PackedCoordinateSequenceFactory()Creates a new PackedCoordinateSequenceFactory of type DOUBLE.PackedCoordinateSequenceFactory(int type)Creates a new PackedCoordinateSequenceFactory of the given type.PackedCoordinateSequenceFactory(int type, int dimension)Creates a new PackedCoordinateSequenceFactory of the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateSequencecreate(double[] packedCoordinates, int dimension)CoordinateSequencecreate(float[] packedCoordinates, int dimension)CoordinateSequencecreate(int size, int dimension)Creates aCoordinateSequenceof the specified size and dimension.CoordinateSequencecreate(Coordinate[] coordinates)Returns aCoordinateSequencebased on the given array.CoordinateSequencecreate(CoordinateSequence coordSeq)Creates aCoordinateSequencewhich is a copy of the givenCoordinateSequence.intgetDimension()intgetType()Returns the type of packed coordinate sequences this factory builds, either PackedCoordinateSequenceFactory#Float or PackedCoordinateSequenceFactory#DoublevoidsetDimension(int dimension)voidsetType(int type)Sets the type of packed coordinate sequences this factory builds, acceptable values are PackedCoordinateSequenceFactory#Floator PackedCoordinateSequenceFactory#Double
-
-
-
Field Detail
-
DOUBLE
public static final int DOUBLE
- See Also:
- Constant Field Values
-
FLOAT
public static final int FLOAT
- See Also:
- Constant Field Values
-
DOUBLE_FACTORY
public static final PackedCoordinateSequenceFactory DOUBLE_FACTORY
-
FLOAT_FACTORY
public static final PackedCoordinateSequenceFactory FLOAT_FACTORY
-
-
Constructor Detail
-
PackedCoordinateSequenceFactory
public PackedCoordinateSequenceFactory()
Creates a new PackedCoordinateSequenceFactory of type DOUBLE.
-
PackedCoordinateSequenceFactory
public PackedCoordinateSequenceFactory(int type)
Creates a new PackedCoordinateSequenceFactory of the given type. Acceptable type values are PackedCoordinateSequenceFactory#Floator PackedCoordinateSequenceFactory#Double
-
PackedCoordinateSequenceFactory
public PackedCoordinateSequenceFactory(int type, int dimension)
-
-
Method Detail
-
getType
public int getType()
Returns the type of packed coordinate sequences this factory builds, either PackedCoordinateSequenceFactory#Float or PackedCoordinateSequenceFactory#Double
-
setType
public void setType(int type)
Sets the type of packed coordinate sequences this factory builds, acceptable values are PackedCoordinateSequenceFactory#Floator PackedCoordinateSequenceFactory#Double
-
getDimension
public int getDimension()
-
setDimension
public void setDimension(int dimension)
-
create
public CoordinateSequence create(Coordinate[] coordinates)
Description copied from interface:CoordinateSequenceFactoryReturns aCoordinateSequencebased on the given array. Whether the array is copied or simply referenced is implementation-dependent. This method must handle null arguments by creating an empty sequence.- Specified by:
createin interfaceCoordinateSequenceFactory- Parameters:
coordinates- the coordinates- See Also:
CoordinateSequenceFactory.create(org.meteoinfo.jts.geom.Coordinate[])
-
create
public CoordinateSequence create(CoordinateSequence coordSeq)
Description copied from interface:CoordinateSequenceFactoryCreates aCoordinateSequencewhich is a copy of the givenCoordinateSequence. This method must handle null arguments by creating an empty sequence.- Specified by:
createin interfaceCoordinateSequenceFactory- Parameters:
coordSeq- the coordinate sequence to copy- See Also:
CoordinateSequenceFactory.create(org.meteoinfo.jts.geom.CoordinateSequence)
-
create
public CoordinateSequence create(double[] packedCoordinates, int dimension)
- See Also:
org.meteoinfo.jts.geom.CoordinateSequenceFactory#create(double[], int)
-
create
public CoordinateSequence create(float[] packedCoordinates, int dimension)
- See Also:
org.meteoinfo.jts.geom.CoordinateSequenceFactory#create(float[], int)
-
create
public CoordinateSequence create(int size, int dimension)
Description copied from interface:CoordinateSequenceFactoryCreates aCoordinateSequenceof the specified size and dimension. For this to be useful, theCoordinateSequenceimplementation must be mutable.If the requested dimension is larger than the CoordinateSequence implementation can provide, then a sequence of maximum possible dimension should be created. An error should not be thrown.
- Specified by:
createin interfaceCoordinateSequenceFactory- Parameters:
size- the number of coordinates in the sequencedimension- the dimension of the coordinates in the sequence (if user-specifiable, otherwise ignored)- See Also:
CoordinateSequenceFactory.create(int, int)
-
-