Package org.locationtech.jts.geom.impl
Class PackedCoordinateSequence.Float
- java.lang.Object
-
- org.locationtech.jts.geom.impl.PackedCoordinateSequence
-
- org.locationtech.jts.geom.impl.PackedCoordinateSequence.Float
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,CoordinateSequence
- Enclosing class:
- PackedCoordinateSequence
public static class PackedCoordinateSequence.Float extends PackedCoordinateSequence
Packed coordinate sequence implementation based on floats- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.locationtech.jts.geom.impl.PackedCoordinateSequence
PackedCoordinateSequence.Double, PackedCoordinateSequence.Float
-
-
Field Summary
-
Fields inherited from interface org.locationtech.jts.geom.CoordinateSequence
M, X, Y, Z
-
-
Constructor Summary
Constructors Constructor Description Float(double[] coords, int dimension, int measures)
Constructs a packed coordinate sequence from an array ofdouble
sFloat(float[] coords, int dimension, int measures)
Constructs a packed coordinate sequence from an array offloat
sFloat(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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
clone()
Deprecated.PackedCoordinateSequence.Float
copy()
Returns a deep copy of this collection.Envelope
expandEnvelope(Envelope env)
Expands the givenEnvelope
to include the coordinates in the sequence.Coordinate
getCoordinateInternal(int i)
double
getOrdinate(int index, int ordinate)
Returns the ordinate of a coordinate in this sequence.float[]
getRawCoordinates()
Gets the underlying array containing the coordinate values.void
setOrdinate(int index, int ordinate, double value)
Sets the ordinate of a coordinate in this sequence.int
size()
Returns the number of coordinates in this sequence.-
Methods inherited from class org.locationtech.jts.geom.impl.PackedCoordinateSequence
getCoordinate, getCoordinate, getCoordinateCopy, getDimension, getMeasures, getX, getY, setX, setY, toCoordinateArray, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.locationtech.jts.geom.CoordinateSequence
createCoordinate, getM, getZ, hasM, hasZ
-
-
-
-
Constructor Detail
-
Float
public Float(float[] coords, int dimension, int measures)
Constructs a packed coordinate sequence from an array offloat
s- Parameters:
coords
- an array offloat
values that contains the ordinate values of the sequencedimension
- the total number of ordinates that make up aCoordinate
in this sequence.measures
- the number of measure-ordinates eachCoordinate
in this sequence has.
-
Float
public Float(double[] coords, int dimension, int measures)
Constructs a packed coordinate sequence from an array ofdouble
s- Parameters:
coords
- an array ofdouble
values that contains the ordinate values of the sequencedimension
- the total number of ordinates that make up aCoordinate
in this sequence.measures
- the number of measure-ordinates eachCoordinate
in this sequence has.
-
Float
public Float(Coordinate[] coordinates, int dimension)
Builds a new packed coordinate sequence out of a coordinate array- Parameters:
coordinates
- an array ofCoordinate
sdimension
- the total number of ordinates that make up aCoordinate
in this sequence.
-
Float
public Float(Coordinate[] coordinates, int dimension, int measures)
Constructs a packed coordinate sequence out of a coordinate array- Parameters:
coordinates
- an array ofCoordinate
sdimension
- the total number of ordinates that make up aCoordinate
in this sequence.measures
- the number of measure-ordinates eachCoordinate
in 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 aCoordinate
in this sequence.measures
- the number of measure-ordinates eachCoordinate
in this sequence has.
-
-
Method Detail
-
getCoordinateInternal
public Coordinate getCoordinateInternal(int i)
-
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:CoordinateSequence
Returns the number of coordinates in this sequence.- Returns:
- the size of the sequence
- See Also:
CoordinateSequence.size()
-
clone
public java.lang.Object clone()
Deprecated.Description copied from interface:CoordinateSequence
Returns a deep copy of this collection. Called by Geometry#clone.- Specified by:
clone
in interfaceCoordinateSequence
- Specified by:
clone
in classPackedCoordinateSequence
- Returns:
- a copy of the coordinate sequence containing copies of all points
- See Also:
Object.clone()
,PackedCoordinateSequence.clone()
-
copy
public PackedCoordinateSequence.Float copy()
Description copied from interface:CoordinateSequence
Returns a deep copy of this collection.- Specified by:
copy
in interfaceCoordinateSequence
- Specified by:
copy
in classPackedCoordinateSequence
- Returns:
- a copy of the coordinate sequence containing copies of all points
- See Also:
PackedCoordinateSequence.copy()
-
getOrdinate
public double getOrdinate(int index, int ordinate)
Description copied from interface:CoordinateSequence
Returns 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:
getOrdinate
in interfaceCoordinateSequence
- Specified by:
getOrdinate
in 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:
For performance reasons the ordinate index is not checked. If it is larger than the dimension a meaningless value may be returned.
-
setOrdinate
public void setOrdinate(int index, int ordinate, double value)
Description copied from class:PackedCoordinateSequence
Sets 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:
setOrdinate
in interfaceCoordinateSequence
- Specified by:
setOrdinate
in 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:
PackedCoordinateSequence.setOrdinate(int, int, double)
-
expandEnvelope
public Envelope expandEnvelope(Envelope env)
Description copied from interface:CoordinateSequence
Expands the givenEnvelope
to 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:
CoordinateSequence.expandEnvelope(Envelope)
-
-