MVT API

math.objects
Class Point2DList

java.lang.Object
  |
  +--math.objects.Point2DList

public class Point2DList
extends java.lang.Object

The class Point2DList allows for a collection of Point2D.Double objects. It is based on the ArrayList class and most methods in this class do what the ArrayList methods do.

Since:
JDK1.2
Version:
1.1
Author:
Peter Staab
, for the Mathematical Visualization Project for the Department of Applied Mathematics, University of Colorado at Boulder

Field Summary
(package private)  java.util.ArrayList points
           
 
Constructor Summary
Point2DList()
           
 
Method Summary
 void add(double x, double y)
          The method add adds a point to the end of the list.
 void add(java.awt.geom.Point2D.Double pt)
          The method add adds a point to the end of the list.
 void add(Point2DList pts)
          The method add adds another Point2DList to the end of the current list.
 void addUniqueElement(double x, double y, double precision)
          The method addUniqueElement add a point only if it is unique in the current list.
 void addUniqueElement(java.awt.geom.Point2D.Double pt, double precision)
          The method addUniqueElement add a point only if it is unique in the current list.
 void addUniqueElements(Point2DList pts, double precision)
          The method addUniqueElements add a list of points only if they are unique in the current list.
 java.lang.Object clone()
          The method clone override the method clone() of an Object.
 java.awt.geom.Point2D.Double get(int i)
          The method get returns the Point2D.Double at the specified position in this list.
 java.util.Iterator iterator()
          The method iterator returns an iterator associated with the current Point2DList.
 int size()
          The method size returns the number of points in the list.
 java.lang.Object[] toArray()
           
 java.lang.String toString()
          The method toString returns a string represenation o the Point2DList.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

points

java.util.ArrayList points
Constructor Detail

Point2DList

public Point2DList()
Method Detail

get

public java.awt.geom.Point2D.Double get(int i)
The method get returns the Point2D.Double at the specified position in this list.

Parameters:
i - an int value
Returns:
a Point2D.Double value

add

public void add(double x,
                double y)
The method add adds a point to the end of the list.

Parameters:
x - a double representing the x value of the point.
y - a double representing the y value of the point.

add

public void add(java.awt.geom.Point2D.Double pt)
The method add adds a point to the end of the list.

Parameters:
pt - a Point2D.Double value

add

public void add(Point2DList pts)
The method add adds another Point2DList to the end of the current list.

Parameters:
pts - a Point2DList that will be added to the end of the current list.

iterator

public java.util.Iterator iterator()
The method iterator returns an iterator associated with the current Point2DList. See the ArrayList documentation for an explanation of iterators.

Returns:
an Iterator object

addUniqueElement

public void addUniqueElement(double x,
                             double y,
                             double precision)
The method addUniqueElement add a point only if it is unique in the current list. If the point (designated by x and y) is within precision of any point in the list then it is not added.

Parameters:
x - a double representing the x coordinate of the point being added.
y - a double representing the y coordinate of the point being added.
precision - a double representing what constitutes a unique point. If two points are within this number the points are not unique.

addUniqueElement

public void addUniqueElement(java.awt.geom.Point2D.Double pt,
                             double precision)
The method addUniqueElement add a point only if it is unique in the current list. If the point is within precision of any point in the list then it is not added.

Parameters:
pt - a Point2D.Double which is the point being added.
precision - a double representing what constitutes a unique point. If two points are within this number the points are not unique.

addUniqueElements

public void addUniqueElements(Point2DList pts,
                              double precision)
The method addUniqueElements add a list of points only if they are unique in the current list. If any point in this list is within precision of any point in the list then it is not added.

Parameters:
pts - a Point2DList which is a list of the points being added.
precision - a double representing what constitutes a unique point. If two points are within this number the points are not unique.

size

public int size()
The method size returns the number of points in the list.

Returns:
an int value

toArray

public java.lang.Object[] toArray()

toString

public java.lang.String toString()
The method toString returns a string represenation o the Point2DList. Each point is printed out on an individual line.

Overrides:
toString in class java.lang.Object
Returns:
a String value

clone

public java.lang.Object clone()
The method clone override the method clone() of an Object. This returns a copy of the current list.

Overrides:
clone in class java.lang.Object
Returns:
an Object value representing a copy of the current list.

MVT API

mvt.icons