org.deegree.geometry.standard.points
Class PointsList

java.lang.Object
  extended by org.deegree.geometry.standard.points.PointsList
All Implemented Interfaces:
com.vividsolutions.jts.geom.CoordinateSequence, Cloneable, Iterable<Point>, Points

public class PointsList
extends Object
implements Points

List-based Points implementation that allows to hold identifiable Point objects (with id or even references to local or remote Point instances}.

This implementation is rather expensive, as every contained point is represented as an individual Point object. Whenever possible, PackedPoints or PointsPoints should be used instead.

Version:
$Revision: 31641 $, $Date: 2011-08-24 21:24:55 +0200 (Wed, 24 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $
See Also:
PackedPoints, PointsPoints

Field Summary
protected  List<Point> points
           
 
Fields inherited from interface com.vividsolutions.jts.geom.CoordinateSequence
M, X, Y, Z
 
Constructor Summary
PointsList(List<Point> points)
          Creates a new PointsList instance based on the given list.
 
Method Summary
 Object clone()
           
 com.vividsolutions.jts.geom.Envelope expandEnvelope(com.vividsolutions.jts.geom.Envelope env)
           
 Point get(int i)
          Returns the Point at the specified position.
 double[] getAsArray()
          Returns all coordinates of the contained Points as an array.
 com.vividsolutions.jts.geom.Coordinate getCoordinate(int index)
           
 void getCoordinate(int index, com.vividsolutions.jts.geom.Coordinate coord)
           
 com.vividsolutions.jts.geom.Coordinate getCoordinateCopy(int index)
           
 int getDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the points are embedded in.
 Point getEndPoint()
          Returns the last point of the sequence.
 double getOrdinate(int index, int ordinateIndex)
           
 Point getStartPoint()
          Returns the first point of the sequence.
 double getX(int index)
           
 double getY(int index)
           
 Iterator<Point> iterator()
           
 void setOrdinate(int index, int ordinateIndex, double value)
           
 int size()
          Returns the number of represented Points.
 com.vividsolutions.jts.geom.Coordinate[] toCoordinateArray()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

protected List<Point> points
Constructor Detail

PointsList

public PointsList(List<Point> points)
Creates a new PointsList instance based on the given list.

Parameters:
points -
Method Detail

getDimension

public int getDimension()
Description copied from interface: Points
Returns the coordinate dimension, i.e. the dimension of the space that the points are embedded in.

Specified by:
getDimension in interface com.vividsolutions.jts.geom.CoordinateSequence
Specified by:
getDimension in interface Points
Returns:
the coordinate dimension

size

public int size()
Description copied from interface: Points
Returns the number of represented Points.

Specified by:
size in interface com.vividsolutions.jts.geom.CoordinateSequence
Specified by:
size in interface Points
Returns:
the number of points

iterator

public Iterator<Point> iterator()
Specified by:
iterator in interface Iterable<Point>

get

public Point get(int i)
Description copied from interface: Points
Returns the Point at the specified position.

NOTE: It is generally more expensive to use this method than to access a Point by iterating over this object, because a new Point object may have to be created (depending on the implementation).

Specified by:
get in interface Points
Returns:
the point at the specified position

getAsArray

public double[] getAsArray()
Description copied from interface: Points
Returns all coordinates of the contained Points as an array.

NOTE: This method should be avoided, as it may involve expensive operations.

Specified by:
getAsArray in interface Points
Returns:
coordinates as a one-dimensional array

getEndPoint

public Point getEndPoint()
Description copied from interface: Points
Returns the last point of the sequence.

Specified by:
getEndPoint in interface Points
Returns:
the last point

getStartPoint

public Point getStartPoint()
Description copied from interface: Points
Returns the first point of the sequence.

Specified by:
getStartPoint in interface Points
Returns:
the first point

expandEnvelope

public com.vividsolutions.jts.geom.Envelope expandEnvelope(com.vividsolutions.jts.geom.Envelope env)
Specified by:
expandEnvelope in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinate

public com.vividsolutions.jts.geom.Coordinate getCoordinate(int index)
Specified by:
getCoordinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinate

public void getCoordinate(int index,
                          com.vividsolutions.jts.geom.Coordinate coord)
Specified by:
getCoordinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getCoordinateCopy

public com.vividsolutions.jts.geom.Coordinate getCoordinateCopy(int index)
Specified by:
getCoordinateCopy in interface com.vividsolutions.jts.geom.CoordinateSequence

getOrdinate

public double getOrdinate(int index,
                          int ordinateIndex)
Specified by:
getOrdinate in interface com.vividsolutions.jts.geom.CoordinateSequence

getX

public double getX(int index)
Specified by:
getX in interface com.vividsolutions.jts.geom.CoordinateSequence

getY

public double getY(int index)
Specified by:
getY in interface com.vividsolutions.jts.geom.CoordinateSequence

setOrdinate

public void setOrdinate(int index,
                        int ordinateIndex,
                        double value)
Specified by:
setOrdinate in interface com.vividsolutions.jts.geom.CoordinateSequence

toCoordinateArray

public com.vividsolutions.jts.geom.Coordinate[] toCoordinateArray()
Specified by:
toCoordinateArray in interface com.vividsolutions.jts.geom.CoordinateSequence

clone

public Object clone()
Specified by:
clone in interface com.vividsolutions.jts.geom.CoordinateSequence
Overrides:
clone in class Object


Copyright © 2011. All Rights Reserved.