math.geom2d.point
Interface PointSet2D

All Superinterfaces:
CirculinearShape2D, GeometricObject2D, java.lang.Iterable<Point2D>, PointShape2D, Shape2D, ShapeSet2D<Point2D>
All Known Implementing Classes:
PointArray2D

public interface PointSet2D
extends PointShape2D, ShapeSet2D<Point2D>

A set of points. All points within the set are instances of Point2D. The most direct implementation of PointSet2D is PointArray2D.

Author:
dlegland

Field Summary
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Method Summary
 boolean add(Point2D point)
          Adds a new point to the point set.
 void addAll(java.util.Collection<? extends Point2D> points)
          Add a series of points
 PointSet2D clip(Box2D box)
          Returns a new point set containing only points located within the box.
 java.util.Collection<Point2D> points()
          Returns the collection of points contained in this set.
 int size()
          Returns the number of points in the set.
 PointSet2D transform(AffineTransform2D trans)
          Transforms the point set by returning a new point set containing each transformed point.
 
Methods inherited from interface math.geom2d.circulinear.CirculinearShape2D
buffer, transform
 
Methods inherited from interface math.geom2d.Shape2D
boundingBox, contains, contains, distance, distance, draw, isBounded, isEmpty
 
Methods inherited from interface math.geom2d.GeometricObject2D
almostEquals
 
Methods inherited from interface math.geom2d.ShapeSet2D
add, clear, contains, get, indexOf, remove, remove
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

add

boolean add(Point2D point)
Adds a new point to the point set. If point is not an instance of Point2D, a Point2D with same location is added instead of point.

Specified by:
add in interface ShapeSet2D<Point2D>
Parameters:
point - the initial point in the set

addAll

void addAll(java.util.Collection<? extends Point2D> points)
Add a series of points

Parameters:
points - an array of points

points

java.util.Collection<Point2D> points()
Returns the collection of points contained in this set.

Specified by:
points in interface PointShape2D
Returns:
the collection of points

size

int size()
Returns the number of points in the set.

Specified by:
size in interface PointShape2D
Specified by:
size in interface ShapeSet2D<Point2D>
Returns:
the number of points

transform

PointSet2D transform(AffineTransform2D trans)
Transforms the point set by returning a new point set containing each transformed point.

Specified by:
transform in interface PointShape2D
Specified by:
transform in interface Shape2D
Parameters:
trans - an affine transform
Returns:
the transformed shape

clip

PointSet2D clip(Box2D box)
Returns a new point set containing only points located within the box.

Specified by:
clip in interface PointShape2D
Specified by:
clip in interface Shape2D
Parameters:
box - the clipping box
Returns:
the clipped shape