|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.geometry.jts.spatialschema.geometry.geometry.PointGridImpl
public class PointGridImpl
A grid of points. The grid may be see as a sequences of equal length sequences.
Constructor Summary | |
---|---|
PointGridImpl()
|
Method Summary | |
---|---|
org.opengis.geometry.DirectPosition |
get(int row,
int column)
Returns the point at the given index. |
org.opengis.geometry.DirectPosition |
get(int row,
int column,
org.opengis.geometry.DirectPosition dest)
Gets a copy of the DirectPosition at the particular location in this
PointGrid . |
org.opengis.geometry.coordinate.PointArray |
getRow(int row)
Returns the row at the given index. |
int |
height()
Returns the length of this array. |
java.util.List |
rows()
Returns all rows in this array. |
void |
set(int row,
int column,
org.opengis.geometry.DirectPosition position)
Set the point at the given index. |
int |
width()
Returns the width of this grid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PointGridImpl()
Method Detail |
---|
public int width()
width
in interface org.opengis.geometry.coordinate.PointGrid
List.size()
public int height()
getRows().size()
.
height
in interface org.opengis.geometry.coordinate.PointGrid
public org.opengis.geometry.DirectPosition get(int row, int column) throws java.lang.IndexOutOfBoundsException
getRow(row).get(column)
.
get
in interface org.opengis.geometry.coordinate.PointGrid
row
- The row index from 0 inclusive to height()
exclusive.column
- The column index from 0 inclusive to width()
exclusive.
java.lang.IndexOutOfBoundsException
- if an index is out of bounds.public org.opengis.geometry.DirectPosition get(int row, int column, org.opengis.geometry.DirectPosition dest) throws java.lang.IndexOutOfBoundsException
DirectPosition
at the particular location in this
PointGrid
. If the dest
argument is non-null, that object
will be populated with the value from the array. In all cases, the position in insulated
from changes in the PointArray
, and vice-versa. Consequently, the same
DirectPosition
object can be reused for fetching many points from this grid.
Example:
DirectPosition position = null; for (int j=0; j<grid.height(); j++) { for (int i=0; i<grid.width(); i++) { position = array.get(j, i, position); // Do some processing... } }
get
in interface org.opengis.geometry.coordinate.PointGrid
row
- The row index from 0 inclusive to height()
exclusive.column
- The column index from 0 inclusive to width()
exclusive.dest
- An optionnaly pre-allocated direct position.
dest
argument, or a new object if dest
was null.
java.lang.IndexOutOfBoundsException
- if an index is out of bounds.public void set(int row, int column, org.opengis.geometry.DirectPosition position) throws java.lang.IndexOutOfBoundsException, java.lang.UnsupportedOperationException
position
after this method call will not be reflected into
this point array. Consequently, the same DirectPosition
object can be
reused for setting many points in this array.
set
in interface org.opengis.geometry.coordinate.PointGrid
row
- The row index from 0 inclusive to height()
exclusive.column
- The column index from 0 inclusive to width()
exclusive.position
- The point to set at the given location in this array.
java.lang.IndexOutOfBoundsException
- if an index is out of bounds.
java.lang.UnsupportedOperationException
- if this grid is immutable.public org.opengis.geometry.coordinate.PointArray getRow(int row) throws java.lang.IndexOutOfBoundsException
getRow
in interface org.opengis.geometry.coordinate.PointGrid
row
- The index from 0 inclusive to height()
exclusive.
java.lang.IndexOutOfBoundsException
- if the index is out of bounds.public java.util.List rows()
rows
in interface org.opengis.geometry.coordinate.PointGrid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |