Class PackedCoordinateSequence.Float
java.lang.Object
org.locationtech.jts.geom.impl.PackedCoordinateSequence
org.locationtech.jts.geom.impl.PackedCoordinateSequence.Float
- All Implemented Interfaces:
Serializable, Cloneable, CoordinateSequence
- Enclosing class:
PackedCoordinateSequence
Packed coordinate sequence implementation based on floats
- Version:
- 1.7
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class PackedCoordinateSequence
PackedCoordinateSequence.Double, PackedCoordinateSequence.Float -
Field Summary
Fields inherited from class PackedCoordinateSequence
coordRef, dimension, measuresFields inherited from interface CoordinateSequence
M, X, Y, Z -
Constructor Summary
ConstructorsConstructorDescriptionFloat(double[] coords, int dimension, int measures) Constructs a packed coordinate sequence from an array ofdoublesFloat(float[] coords, int dimension, int measures) Constructs a packed coordinate sequence from an array offloatsFloat(int size, int dimension, int measures) Constructs an empty packed coordinate sequence of a given size and dimensionFloat(Coordinate[] coordinates, int dimension) Builds a new packed coordinate sequence out of a coordinate arrayFloat(Coordinate[] coordinates, int dimension, int measures) Constructs a packed coordinate sequence out of a coordinate array -
Method Summary
Modifier and TypeMethodDescriptionclone()Deprecated.copy()Returns a deep copy of this collection.expandEnvelope(Envelope env) Expands the givenEnvelopeto include the coordinates in the sequence.getCoordinateInternal(int i) Returns a Coordinate representation of the specified coordinate, by always building a new Coordinate objectdoublegetOrdinate(int index, int ordinate) Returns the ordinate of a coordinate in this sequence.float[]Gets the underlying array containing the coordinate values.voidsetOrdinate(int index, int ordinate, double value) Sets the ordinate of a coordinate in this sequence.intsize()Returns the number of coordinates in this sequence.Methods inherited from class PackedCoordinateSequence
getCoordinate, getCoordinate, getCoordinateCopy, getDimension, getMeasures, getX, getY, readResolve, setX, setY, toCoordinateArray, toStringMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface CoordinateSequence
createCoordinate, getM, getZ, hasM, hasZ
-
Constructor Details
-
Float
public Float(float[] coords, int dimension, int measures) Constructs a packed coordinate sequence from an array offloats- Parameters:
coords- an array offloatvalues that contains the ordinate values of the sequencedimension- the total number of ordinates that make up aCoordinatein this sequence.measures- the number of measure-ordinates eachCoordinatein this sequence has.
-
Float
public Float(double[] coords, int dimension, int measures) Constructs a packed coordinate sequence from an array ofdoubles- Parameters:
coords- an array ofdoublevalues that contains the ordinate values of the sequencedimension- the total number of ordinates that make up aCoordinatein this sequence.measures- the number of measure-ordinates eachCoordinatein this sequence has.
-
Float
Builds a new packed coordinate sequence out of a coordinate array- Parameters:
coordinates- an array ofCoordinatesdimension- the total number of ordinates that make up aCoordinatein this sequence.
-
Float
Constructs a packed coordinate sequence out of a coordinate array- Parameters:
coordinates- an array ofCoordinatesdimension- the total number of ordinates that make up aCoordinatein this sequence.measures- the number of measure-ordinates eachCoordinatein this sequence has.
-
Float
public Float(int size, int dimension, int measures) Constructs an empty packed coordinate sequence of a given size and dimension- Parameters:
size- the number of coordinates in this sequencedimension- the total number of ordinates that make up aCoordinatein this sequence.measures- the number of measure-ordinates eachCoordinatein this sequence has.
-
-
Method Details
-
getCoordinateInternal
Description copied from class:PackedCoordinateSequenceReturns a Coordinate representation of the specified coordinate, by always building a new Coordinate object- Specified by:
getCoordinateInternalin classPackedCoordinateSequence- Parameters:
i- the coordinate index- Returns:
- the
Coordinateat the given index - See Also:
-
getRawCoordinates
public float[] getRawCoordinates()Gets the underlying array containing the coordinate values.- Returns:
- the array of coordinate values
-
size
public int size()Description copied from interface:CoordinateSequenceReturns the number of coordinates in this sequence.- Returns:
- the size of the sequence
- See Also:
-
clone
Deprecated.Description copied from interface:CoordinateSequenceReturns a deep copy of this collection. Called by Geometry#clone.- Specified by:
clonein interfaceCoordinateSequence- Specified by:
clonein classPackedCoordinateSequence- Returns:
- a copy of the coordinate sequence containing copies of all points
- See Also:
-
copy
Description copied from interface:CoordinateSequenceReturns a deep copy of this collection.- Specified by:
copyin interfaceCoordinateSequence- Specified by:
copyin classPackedCoordinateSequence- Returns:
- a copy of the coordinate sequence containing copies of all points
- See Also:
-
getOrdinate
public double getOrdinate(int index, int ordinate) Description copied from interface:CoordinateSequenceReturns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y.Ordinates indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values as described by
CoordinateSequence.getDimension()andCoordinateSequence.getMeasures()).- Specified by:
getOrdinatein interfaceCoordinateSequence- Specified by:
getOrdinatein classPackedCoordinateSequence- Parameters:
index- the coordinate index in the sequenceordinate- the ordinate index in the coordinate (in range [0, dimension-1])- Returns:
- ordinate value
- See Also:
-
setOrdinate
public void setOrdinate(int index, int ordinate, double value) Description copied from class:PackedCoordinateSequenceSets the ordinate of a coordinate in this sequence.
Warning: for performance reasons the ordinate index is not checked - if it is over dimensions you may not get an exception but a meaningless value.- Specified by:
setOrdinatein interfaceCoordinateSequence- Specified by:
setOrdinatein classPackedCoordinateSequence- Parameters:
index- the coordinate indexordinate- the ordinate index in the coordinate, 0 based, smaller than the number of dimensionsvalue- the new ordinate value- See Also:
-
expandEnvelope
Description copied from interface:CoordinateSequenceExpands the givenEnvelopeto include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.- Parameters:
env- the envelope to expand- Returns:
- a ref to the expanded envelope
- See Also:
-