org.deegree.geometry.standard.points
Class PointsSubsequence

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

public class PointsSubsequence
extends Object
implements Points

Points implementation that aggregates the members from a sequence of Points objects.

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

Field Summary
 
Fields inherited from interface com.vividsolutions.jts.geom.CoordinateSequence
M, X, Y, Z
 
Constructor Summary
PointsSubsequence(Points points, int startIdx)
          Creates a new PointsSubsequence instance from the given list of Points.
 
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
 

Constructor Detail

PointsSubsequence

public PointsSubsequence(Points points,
                         int startIdx)
Creates a new PointsSubsequence instance from the given list of Points.

Parameters:
points -
startIdx -
Method Detail

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

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>

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.