Class PackedCoordinateSequence

Hierarchy: Object , PackedCoordinateSequence
All Implemented Interfaces: Cloneable , CoordinateSequence, Serializable
public abstract class PackedCoordinateSequence
implements Serializable , CoordinateSequence
A CoordinateSequence implementation based on a packed arrays. In this implementation, Coordinates returned by #toArray and #get are copies of the internal values. To change the actual values, use the provided setters.

For efficiency, created Coordinate arrays are cached using a soft reference. The cache is cleared each time the coordinate sequence contents are modified through a setter method.

Other

  • version: 1.7
protected PackedCoordinateSequence(int dimension, int measures)
Creates an instance of this class
Parameters:
dimension - dimension the total number of ordinates that make up a Coordinate in this sequence.
measures - measures the number of measure-ordinates each Coordinate in this sequence has.
public int getDimension()
See also:
CoordinateSequence#getDimension()
public int getMeasures()
See also:
CoordinateSequence#getMeasures()
public Coordinate getCoordinate(int i)
See also:
CoordinateSequence#getCoordinate(int)
public Coordinate getCoordinateCopy(int i)
See also:
CoordinateSequence#getCoordinate(int)
public void getCoordinate(int i, Coordinate coord)
See also:
CoordinateSequence#getCoordinate(int)
public Coordinate[] toCoordinateArray()
See also:
CoordinateSequence#toCoordinateArray()
public double getX(int index)
See also:
CoordinateSequence#getX(int)
public double getY(int index)
See also:
CoordinateSequence#getY(int)
public abstract abstract double getOrdinate(int index, int ordinateIndex)
See also:
CoordinateSequence#getOrdinate(int, int)
public void setX(int index, double value)
Sets the first ordinate of a coordinate in this sequence.
Parameters:
index - index the coordinate index
value - value the new ordinate value
public void setY(int index, double value)
Sets the second ordinate of a coordinate in this sequence.
Parameters:
index - index the coordinate index
value - value the new ordinate value
public String toString()
protected Object readResolve()
protected abstract abstract Coordinate getCoordinateInternal(int index)
Returns a Coordinate representation of the specified coordinate, by always building a new Coordinate object
Parameters:
index - index the coordinate index
Returns:
the Coordinate at the given index
public abstract abstract Object clone()
See also:
java.lang.Object#clone()
CoordinateSequence#clone()
public abstract abstract PackedCoordinateSequence copy()
public abstract abstract void setOrdinate(int index, int ordinate, double value)
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.
Parameters:
index - index the coordinate index
ordinate - ordinate the ordinate index in the coordinate, 0 based, smaller than the number of dimensions
value - value the new ordinate value