Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.vividsolutions.jts.geom.impl.CoordinateArraySequence
public class CoordinateArraySequence
extends java.lang.Object
implements CoordinateSequence, Serializable
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.
Fields inherited from interface com.vividsolutions.jts.geom.CoordinateSequence | |
M , X , Y , Z |
Constructor Summary | |
| |
| |
|
Method Summary | |
Object |
|
Envelope |
|
Coordinate |
|
void |
|
Coordinate |
|
int | |
double |
|
double |
|
double |
|
void |
|
int |
|
Coordinate[] |
|
String |
|
public CoordinateArraySequence(CoordinateSequence coordSeq)
Constructs a sequence based on the given array (the array is not copied).
- Parameters:
public CoordinateArraySequence(Coordinate[] coordinates)
Constructs a sequence based on the given array (the array is not copied).
- Parameters:
coordinates
- the coordinate array that will be referenced.
public CoordinateArraySequence(int size)
Constructs a sequence of a given size, populated with newCoordinate
s.
- Parameters:
size
- the size of the sequence to create
public Object clone()
Creates a deep copy of the Object
- Specified by:
- clone in interface CoordinateSequence
- Returns:
- The deep copy
public Envelope expandEnvelope(Envelope env)
Expands the givenEnvelope
to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.
- Specified by:
- expandEnvelope in interface CoordinateSequence
- Parameters:
env
- the envelope to expand
- Returns:
- a ref to the expanded envelope
public Coordinate getCoordinate(int i)
Get the Coordinate with index i.
- Specified by:
- getCoordinate in interface CoordinateSequence
- Parameters:
i
- the index of the coordinate
- Returns:
- the requested Coordinate instance
public void getCoordinate(int index, Coordinate coord)
- Specified by:
- getCoordinate in interface CoordinateSequence
- See Also:
CoordinateSequence.getX(int)
public Coordinate getCoordinateCopy(int i)
Get a copy of the Coordinate with index i.
- Specified by:
- getCoordinateCopy in interface CoordinateSequence
- Parameters:
i
- the index of the coordinate
- Returns:
- a copy of the requested Coordinate
public int getDimension()
- Specified by:
- getDimension in interface CoordinateSequence
- See Also:
CoordinateSequence.getDimension()
public double getOrdinate(int index, int ordinateIndex)
- Specified by:
- getOrdinate in interface CoordinateSequence
public double getX(int index)
- Specified by:
- getX in interface CoordinateSequence
- See Also:
CoordinateSequence.getX(int)
public double getY(int index)
- Specified by:
- getY in interface CoordinateSequence
- See Also:
CoordinateSequence.getY(int)
public void setOrdinate(int index, int ordinateIndex, double value)
- Specified by:
- setOrdinate in interface CoordinateSequence
public int size()
Returns the size of the coordinate sequence
- Specified by:
- size in interface CoordinateSequence
- Returns:
- the number of coordinates
public Coordinate[] toCoordinateArray()
This method exposes the internal Array of Coordinate Objects
- Specified by:
- toCoordinateArray in interface CoordinateSequence
- Returns:
- the Coordinate[] array.
public String toString()
Returns the string Representation of the coordinate array
- Returns:
- The string