Package org.locationtech.jts.geom.impl
Class PackedCoordinateSequenceFactory
java.lang.Object
org.locationtech.jts.geom.impl.PackedCoordinateSequenceFactory
- All Implemented Interfaces:
Serializable
,CoordinateSequenceFactory
public class PackedCoordinateSequenceFactory
extends Object
implements CoordinateSequenceFactory, Serializable
Builds packed array coordinate sequences. The array data type can be either
double or float, and defaults to float.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
static final int
static final PackedCoordinateSequenceFactory
static final int
static final PackedCoordinateSequenceFactory
private static final long
private int
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptioncreate
(double[] packedCoordinates, int dimension) create
(float[] packedCoordinates, int dimension) create
(int size, int dimension) Creates aCoordinateSequence
of the specified size and dimension.create
(Coordinate[] coordinates) Returns aCoordinateSequence
based on the given array.create
(CoordinateSequence coordSeq) Creates aCoordinateSequence
which is a copy of the givenCoordinateSequence
.int
int
getType()
Returns the type of packed coordinate sequences this factory builds, eitherinvalid reference
PackedCoordinateSequenceFactory#Float
invalid reference
PackedCoordinateSequenceFactory#Double
void
setDimension
(int dimension) void
setType
(int type) Sets the type of packed coordinate sequences this factory builds, acceptable values areinvalid reference
PackedCoordinateSequenceFactory#Float
invalid reference
PackedCoordinateSequenceFactory#Double
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
DOUBLE
public static final int DOUBLE- See Also:
-
FLOAT
public static final int FLOAT- See Also:
-
DOUBLE_FACTORY
-
FLOAT_FACTORY
-
type
private int type -
dimension
private int dimension
-
-
Constructor Details
-
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 areinvalid reference
PackedCoordinateSequenceFactory#Float
invalid reference
PackedCoordinateSequenceFactory#Double
-
PackedCoordinateSequenceFactory
public PackedCoordinateSequenceFactory(int type, int dimension)
-
-
Method Details
-
getType
public int getType()Returns the type of packed coordinate sequences this factory builds, eitherinvalid reference
PackedCoordinateSequenceFactory#Float
invalid reference
PackedCoordinateSequenceFactory#Double
-
setType
public void setType(int type) Sets the type of packed coordinate sequences this factory builds, acceptable values areinvalid reference
PackedCoordinateSequenceFactory#Float
invalid reference
PackedCoordinateSequenceFactory#Double
-
getDimension
public int getDimension() -
setDimension
public void setDimension(int dimension) -
create
Description copied from interface:CoordinateSequenceFactory
Returns aCoordinateSequence
based 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:
create
in interfaceCoordinateSequenceFactory
- Parameters:
coordinates
- the coordinates- See Also:
-
create
Description copied from interface:CoordinateSequenceFactory
Creates aCoordinateSequence
which is a copy of the givenCoordinateSequence
. This method must handle null arguments by creating an empty sequence.- Specified by:
create
in interfaceCoordinateSequenceFactory
- Parameters:
coordSeq
- the coordinate sequence to copy- See Also:
-
create
- See Also:
-
create
- See Also:
-
create
Description copied from interface:CoordinateSequenceFactory
Creates aCoordinateSequence
of the specified size and dimension. For this to be useful, theCoordinateSequence
implementation 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:
create
in 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:
-