|
MVT API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--math.objects.Point2DList
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.
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 |
java.util.ArrayList points
Constructor Detail |
public Point2DList()
Method Detail |
public java.awt.geom.Point2D.Double get(int i)
get
returns the Point2D.Double
at the specified position in this list.
i
- an int
value
Point2D.Double
valuepublic void add(double x, double y)
add
adds a point to the end of the
list.
x
- a double
representing the x value of the point.y
- a double
representing the y value of the point.public void add(java.awt.geom.Point2D.Double pt)
add
adds a point to the end of the
list.
pt
- a Point2D.Double
valuepublic void add(Point2DList pts)
add
adds another Point2DList to the
end of the current list.
pts
- a Point2DList
that will be added to the
end of the current list.public java.util.Iterator iterator()
iterator
returns an iterator associated
with the current Point2DList. See the ArrayList
documentation for an explanation of iterators.
Iterator
objectpublic void addUniqueElement(double x, double y, double precision)
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.
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.public void addUniqueElement(java.awt.geom.Point2D.Double pt, double precision)
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.
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.public void addUniqueElements(Point2DList pts, double precision)
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.
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.public int size()
size
returns the number of points in the list.
int
valuepublic java.lang.Object[] toArray()
public java.lang.String toString()
toString
returns a string represenation o
the Point2DList. Each point is printed out on an individual line.
toString
in class java.lang.Object
String
valuepublic java.lang.Object clone()
clone
override the method clone()
of an Object
. This returns a copy of the
current list.
clone
in class java.lang.Object
Object
value representing a copy of the
current list.
|
MVT API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |