|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<T>
org.geotools.geometry.jts.spatialschema.geometry.NotifyingArrayList<org.opengis.geometry.coordinate.Position>
org.geotools.geometry.jts.spatialschema.geometry.geometry.PointArrayImpl
public class PointArrayImpl
A sequence of points. The PointArray
interface outlines a means
of efficiently storing large numbers of homogeneous DirectPosition
s;
i.e. all having the same coordinate reference
system. Classes implementing the PointArray
interface are not required
to store only one type of DirectPosition
(the benefit of a homogenous
collection arises in sub-interfaces). A simple implementation of PointArray
will generally be no more efficient than a simple array of DirectPosition
s.
PointArray
is similar to {@link List}<{@link DirectPosition}>
from the collection
framework. Implementations are free to implement directly the List
interface.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
PointArrayImpl()
|
|
PointArrayImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
|
|
PointArrayImpl(JTSGeometry parent,
org.opengis.referencing.crs.CoordinateReferenceSystem crs)
|
Method Summary | |
---|---|
org.opengis.geometry.coordinate.Position |
get(int column)
Returns the point at the given index. |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the Coordinate Reference System of this array. |
int |
getDimension()
Returns the dimensionality of the coordinates in this array. |
org.opengis.geometry.DirectPosition |
getDirectPosition(int column,
org.opengis.geometry.DirectPosition dest)
Gets the DirectPosition at the particular location in this
PointArray . |
com.vividsolutions.jts.geom.Geometry |
getJTSGeometry()
Retrieves the equivalent JTS geometry for this object. |
int |
length()
Returns the size (the number of elements) of this array. |
java.util.List |
positions()
Returns a view of the points in this array as a list of positions. |
void |
setDirectPosition(int column,
org.opengis.geometry.DirectPosition position)
Set the point at the given index. |
java.lang.Object[] |
toArray()
Returns the elements of this PointArray as an array of
DirectPosition s. |
Methods inherited from class org.geotools.geometry.jts.spatialschema.geometry.NotifyingArrayList |
---|
add, add, addAll, addAll, clear, getJTSParent, invalidateCachedJTSPeer, remove, set, setJTSParent |
Methods inherited from class java.util.ArrayList |
---|
clone, contains, ensureCapacity, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeRange, retainAll, size, subList, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray |
Methods inherited from interface org.geotools.geometry.jts.JTSGeometry |
---|
invalidateCachedJTSPeer |
Constructor Detail |
---|
public PointArrayImpl()
public PointArrayImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
public PointArrayImpl(JTSGeometry parent, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Method Detail |
---|
public int length()
getColumns().size()
.
length
in interface org.opengis.geometry.coordinate.PointArray
List.size()
,
PointGrid.width()
public int getDimension()
getDimension
in interface org.opengis.geometry.coordinate.PointArray
DirectPosition.getDimension()
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
getCoordinateReferenceSystem
in interface org.opengis.geometry.coordinate.PointArray
DirectPosition.getCoordinateReferenceSystem()
public org.opengis.geometry.coordinate.Position get(int column) throws java.lang.IndexOutOfBoundsException
getColumns().get(column).getDirect()
.
get
in interface java.util.List<org.opengis.geometry.coordinate.Position>
get
in class java.util.ArrayList<org.opengis.geometry.coordinate.Position>
column
- The location in the array, from 0 inclusive
to the array's ArrayList.size exclusive.
java.lang.IndexOutOfBoundsException
- if the index is out of bounds.List.get(int)
,
#get(int, DirectPosition)
public org.opengis.geometry.DirectPosition getDirectPosition(int column, org.opengis.geometry.DirectPosition dest) throws java.lang.IndexOutOfBoundsException
DirectPosition
at the particular location in this
PointArray
. If the dest
argument is non-null,
that object will be populated with the value from the list.
getDirectPosition
in interface org.opengis.geometry.coordinate.PointArray
column
- The location in the array, from 0 inclusive
to the array's ArrayList.size exclusive.dest
- An optionnaly pre-allocated direct position.
dest
argument, or a new object if dest
was null.
java.lang.IndexOutOfBoundsException
- if the index is out of bounds.get(int)
public void setDirectPosition(int column, org.opengis.geometry.DirectPosition position) throws java.lang.IndexOutOfBoundsException
setDirectPosition
in interface org.opengis.geometry.coordinate.PointArray
column
- The location in the array, from 0 inclusive
to the array's ArrayList.size exclusive.position
- The point to set at the given location in this array.
The point coordinates will be copied, i.e. changes to the given
position
after the method call will not be reflected
to this array.
java.lang.IndexOutOfBoundsException
- if the index is out of bounds.List.set(int, E)
public java.lang.Object[] toArray()
PointArray
as an array of
DirectPosition
s.
toArray
in interface java.util.Collection<org.opengis.geometry.coordinate.Position>
toArray
in interface java.util.List<org.opengis.geometry.coordinate.Position>
toArray
in class java.util.ArrayList<org.opengis.geometry.coordinate.Position>
List.toArray()
public java.util.List positions()
PointArray
, so changes to the array are reflected
in the list, and vice-versa.
positions
in interface org.opengis.geometry.coordinate.PointArray
public com.vividsolutions.jts.geom.Geometry getJTSGeometry()
JTSGeometry
getJTSGeometry
in interface JTSGeometry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |