public class ExtendedCoordinateSequence extends Objectimplements CoordinateSequence
ExtendedCoordinate in this example). In this implementation, Coordinates returned by #toArray and #get are live -- parties that change them are actually changing the ExtendedCoordinateSequence's underlying data.
M, X, Y, Z| Constructor and Description |
|---|
ExtendedCoordinateSequence(Coordinate
Constructor that makes a copy of an array of Coordinates.
|
ExtendedCoordinateSequence(CoordinateSequence
Constructor that makes a copy of a CoordinateSequence.
|
ExtendedCoordinateSequence(ExtendedCoordinate
Copy constructor -- simply aliases the input array, for better performance.
|
ExtendedCoordinateSequence(int size)
Constructs a sequence of a given size, populated with new
ExtendedCoordinates.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Returns a deep copy of this collection.
|
static ExtendedCoordinate |
copy(Coordinate
|
static ExtendedCoordinate |
copy(CoordinateSequence
|
Envelope |
expandEnvelope(Envelope
Expands the given
Envelope to include the coordinates in the sequence.
|
Coordinate |
getCoordinate(int i)
Returns (possibly a copy of) the i'th coordinate in this sequence.
|
void |
getCoordinate(int index, Coordinate
Copies the i'th coordinate in the sequence to the supplied
Coordinate.
|
Coordinate |
getCoordinateCopy(int index)
Returns a copy of the i'th coordinate in this sequence.
|
int |
getDimension()
Returns the dimension (number of ordinates in each coordinate) for this sequence.
|
double |
getOrdinate(int index, int ordinateIndex)
Returns the ordinate of a coordinate in this sequence.
|
double |
getX(int index)
Returns ordinate X (0) of the specified coordinate.
|
double |
getY(int index)
Returns ordinate Y (1) of the specified coordinate.
|
void |
setOrdinate(int index, int ordinateIndex, double value)
Sets the value for a given ordinate of a coordinate in this sequence.
|
int |
size()
Returns the number of coordinates in this sequence.
|
Coordinate |
toCoordinateArray()
Returns (possibly copies of) the Coordinates in this collection.
|
String |
toString()
|
public ExtendedCoordinateSequence(ExtendedCoordinate[] coordinates)
public ExtendedCoordinateSequence(Coordinate[] copyCoords)
public ExtendedCoordinateSequence(CoordinateSequencecoordSeq)
public ExtendedCoordinateSequence(int size)
ExtendedCoordinates.
size - the size of the sequence to create
public static ExtendedCoordinate[] copy(Coordinate [] coordinates)
public static ExtendedCoordinate[] copy(CoordinateSequence coordSeq)
public int getDimension()
CoordinateSequence
getDimension in interface
CoordinateSequence
CoordinateSequence.getDimension()
public CoordinategetCoordinate(int i)
CoordinateSequence
Note that in the future the semantics of this method may change to guarantee that the Coordinate returned is always a copy. Callers should not to assume that they can modify a CoordinateSequence by modifying the object returned by this method.
getCoordinate in interface
CoordinateSequence
i - the index of the coordinate to retrieve
public CoordinategetCoordinateCopy(int index)
CoordinateSequence
getCoordinateCopy in interface
CoordinateSequence
index - the index of the coordinate to retrieve
CoordinateSequence.getX(int)
public void getCoordinate(int index,
Coordinate coord)
CoordinateSequence
Coordinate. Only the first two dimensions are copied.
getCoordinate in interface
CoordinateSequence
index - the index of the coordinate to copy
coord - a
Coordinate to receive the value
CoordinateSequence.getX(int)
public double getX(int index)
CoordinateSequence
getX in interface
CoordinateSequence
CoordinateSequence.getX(int)
public double getY(int index)
CoordinateSequence
getY in interface
CoordinateSequence
CoordinateSequence.getY(int)
public double getOrdinate(int index,
int ordinateIndex)
CoordinateSequence
getOrdinate in interface
CoordinateSequence
index - the coordinate index in the sequence
ordinateIndex - the ordinate index in the coordinate (in range [0, dimension-1])
CoordinateSequence.getOrdinate(int, int)
public void setOrdinate(int index,
int ordinateIndex,
double value)
CoordinateSequence
setOrdinate in interface
CoordinateSequence
index - the coordinate index in the sequence
ordinateIndex - the ordinate index in the coordinate (in range [0, dimension-1])
value - the new ordinate value
CoordinateSequence.setOrdinate(int, int, double)
public Objectclone()
CoordinateSequence
clone in interface
CoordinateSequence
clone in class
Object
public int size()
CoordinateSequence
size in interface
CoordinateSequence
public Coordinate[] toCoordinateArray()
CoordinateSequence
toCoordinateArray in interface
CoordinateSequence
public EnvelopeexpandEnvelope(Envelope env)
CoordinateSequence
Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.
expandEnvelope in interface
CoordinateSequence
env - the envelope to expand
public StringtoString()