Class PackedCoordinateSequenceFactory

java.lang.Object
org.apache.sis.internal.feature.jts.PackedCoordinateSequenceFactory
All Implemented Interfaces:
Serializable, org.locationtech.jts.geom.CoordinateSequenceFactory

final class PackedCoordinateSequenceFactory extends Object implements org.locationtech.jts.geom.CoordinateSequenceFactory, Serializable
A factory of JTS coordinate sequence storing coordinates in a single float[] or double[] array. This class serves the same purpose than PackedCoordinateSequenceFactory but without caching the Coordinate[] array.
Since:
1.2
Version:
1.2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
    Whether to use double-precision floating point numbers.
    private static final long
    For cross-version compatibility.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PackedCoordinateSequenceFactory(boolean doublePrecision)
    Creates a new factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.locationtech.jts.geom.CoordinateSequence
    create(int size, int dimension)
    Creates a new coordinate sequence for the given number of dimensions.
    create(int size, int dimension, int measures)
    Creates a new coordinate sequence for the given number of dimensions and measures.
    org.locationtech.jts.geom.CoordinateSequence
    create(org.locationtech.jts.geom.Coordinate[] coordinates)
    Creates a new sequence with the given coordinates.
    org.locationtech.jts.geom.CoordinateSequence
    create(org.locationtech.jts.geom.CoordinateSequence original)
    Creates a new sequence as a copy of the given sequence.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • doublePrecision

      protected final boolean doublePrecision
      Whether to use double-precision floating point numbers.
  • Constructor Details

    • PackedCoordinateSequenceFactory

      PackedCoordinateSequenceFactory(boolean doublePrecision)
      Creates a new factory.
      Parameters:
      doublePrecision - whether to use double-precision floating point numbers.
  • Method Details

    • create

      public org.locationtech.jts.geom.CoordinateSequence create(org.locationtech.jts.geom.Coordinate[] coordinates)
      Creates a new sequence with the given coordinates. All values are copied. The number of dimensions of the sequence is the minimal number of dimensions found in all coordinates. We use the minimal number because requesting a inexistent dimension or measure in Coordinate may cause an exception to be thrown.
      Specified by:
      create in interface org.locationtech.jts.geom.CoordinateSequenceFactory
      Parameters:
      coordinates - the coordinate values, or null for an empty sequence.
      Returns:
      a newly created coordinate sequence with the given coordinate values.
    • create

      public org.locationtech.jts.geom.CoordinateSequence create(org.locationtech.jts.geom.CoordinateSequence original)
      Creates a new sequence as a copy of the given sequence.
      Specified by:
      create in interface org.locationtech.jts.geom.CoordinateSequenceFactory
      Parameters:
      original - the sequence to copy, or null for an empty sequence.
      Returns:
      a newly created coordinate sequence with the values of the given sequence.
    • create

      public org.locationtech.jts.geom.CoordinateSequence create(int size, int dimension)
      Creates a new coordinate sequence for the given number of dimensions.
      Specified by:
      create in interface org.locationtech.jts.geom.CoordinateSequenceFactory
      Parameters:
      size - number of coordinate tuples.
      dimension - number of dimensions, 2 or 3.
      Returns:
      a newly created coordinate sequence with all values initialized to zero.
    • create

      public PackedCoordinateSequence create(int size, int dimension, int measures)
      Creates a new coordinate sequence for the given number of dimensions and measures.
      Specified by:
      create in interface org.locationtech.jts.geom.CoordinateSequenceFactory
      Parameters:
      size - number of coordinate tuples.
      dimension - number of dimensions, including the number of measures.
      measures - number of M coordinates.
      Returns:
      a newly created coordinate sequence with all values initialized to zero.