y.geom
Class YPointPath

java.lang.Object
  |
  +--y.geom.YPointPath

public final class YPointPath
extends Object

This class represents an ordered list of points in the plane.


Field Summary
static YPointPath EMPTY_PATH
          Defines a path with no points.
 
Constructor Summary
YPointPath()
          Creates a new path from a vector.
YPointPath(Vector v)
          Creates a new path from a vector.
YPointPath(YPoint[] path)
          Creates a new path from an array of points.
 
Method Summary
 YPointPath createReverse()
          Create a point path with reverse ordering of the points.
 YCursor cursor()
          Get the points in the path.
 YPoint getFirst()
          Get the first point in the path.
 YPoint getLast()
          Get the first point in the path.
 LineSegment getLineSegment(int i)
          Returns a line segment in the path.
 Iterator iterator()
          Get the points in the path.
 int length()
          Get the number of points in the path.
 YLineSegmentCursor lineSegments()
          Get the points in the path.
 YPointCursor points()
          Get the points in the path.
 YPoint[] toArray()
          Get the points in the list as array.
 String toString()
           
 Vector toVector()
          Get the points in the list as vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_PATH

public static final YPointPath EMPTY_PATH
Defines a path with no points.

Constructor Detail

YPointPath

public YPointPath()
Creates a new path from a vector.


YPointPath

public YPointPath(Vector v)
Creates a new path from a vector.


YPointPath

public YPointPath(YPoint[] path)
Creates a new path from an array of points.

Method Detail

cursor

public YCursor cursor()
Get the points in the path.


points

public YPointCursor points()
Get the points in the path.


iterator

public Iterator iterator()
Get the points in the path.


getFirst

public YPoint getFirst()
Get the first point in the path.


getLast

public YPoint getLast()
Get the first point in the path.


toVector

public Vector toVector()
Get the points in the list as vector.


toArray

public YPoint[] toArray()
Get the points in the list as array.


createReverse

public YPointPath createReverse()
Create a point path with reverse ordering of the points.


length

public int length()
Get the number of points in the path.


lineSegments

public YLineSegmentCursor lineSegments()
Get the points in the path.


getLineSegment

public LineSegment getLineSegment(int i)
Returns a line segment in the path.


toString

public String toString()
Overrides:
toString in class Object

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003