|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vividsolutions.jts.geom.impl.CoordinateArraySequence
public class CoordinateArraySequence
The CoordinateSequence
implementation that Geometry
s use by default.
In this implementation, Coordinates returned by #toArray and #getCoordinate are live --
modifications to them are actually changing the
CoordinateSequence's underlying data.
Field Summary |
---|
Fields inherited from interface com.vividsolutions.jts.geom.CoordinateSequence |
---|
M, X, Y, Z |
Constructor Summary | |
---|---|
CoordinateArraySequence(Coordinate[] coordinates)
Constructs a sequence based on the given array (the array is not copied). |
|
CoordinateArraySequence(CoordinateSequence coordSeq)
Constructs a sequence based on the given array (the array is not copied). |
|
CoordinateArraySequence(int size)
Constructs a sequence of a given size, populated with new Coordinate s. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a deep copy of the Object |
Envelope |
expandEnvelope(Envelope env)
Expands the given Envelope to include the coordinates in the sequence. |
Coordinate |
getCoordinate(int i)
Get the Coordinate with index i. |
void |
getCoordinate(int index,
Coordinate coord)
Copies the i'th coordinate in the sequence to the supplied Coordinate . |
Coordinate |
getCoordinateCopy(int i)
Get a copy of the Coordinate with index i. |
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 size of the coordinate sequence |
Coordinate[] |
toCoordinateArray()
This method exposes the internal Array of Coordinate Objects |
java.lang.String |
toString()
Returns the string Representation of the coordinate array |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CoordinateArraySequence(Coordinate[] coordinates)
coordinates
- the coordinate array that will be referenced.public CoordinateArraySequence(int size)
Coordinate
s.
size
- the size of the sequence to createpublic CoordinateArraySequence(CoordinateSequence coordSeq)
coordinates
- the coordinate array that will be referenced.Method Detail |
---|
public int getDimension()
CoordinateSequence
getDimension
in interface CoordinateSequence
CoordinateSequence.getDimension()
public Coordinate getCoordinate(int i)
getCoordinate
in interface CoordinateSequence
i
- the index of the coordinate
public Coordinate getCoordinateCopy(int i)
getCoordinateCopy
in interface CoordinateSequence
i
- the index of the coordinate
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 copycoord
- a Coordinate
to receive the valueCoordinateSequence.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 sequenceordinateIndex
- the ordinate index in the coordinate (in range [0, dimension-1])CoordinateSequence.getOrdinate(int, int)
public java.lang.Object clone()
clone
in interface CoordinateSequence
clone
in class java.lang.Object
public int size()
size
in interface CoordinateSequence
public void setOrdinate(int index, int ordinateIndex, double value)
CoordinateSequence
setOrdinate
in interface CoordinateSequence
index
- the coordinate index in the sequenceordinateIndex
- the ordinate index in the coordinate (in range [0, dimension-1])value
- the new ordinate valueCoordinateSequence.setOrdinate(int, int, double)
public Coordinate[] toCoordinateArray()
toCoordinateArray
in interface CoordinateSequence
public Envelope expandEnvelope(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 java.lang.String toString()
toString
in class java.lang.Object
|
JTS Topology Suite version 1.12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |