All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class att.grappa.LineVector

java.lang.Object
   |
   +----java.util.Vector
           |
           +----att.grappa.LineVector

public class LineVector
extends Vector
Calculates and stores a bezier spline of degree 3 from a Vector of control points.

Version:
1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs

Constructor Index

 o LineVector()
Construct an empty line vector.
 o LineVector(int)
Constructs an empty line vector with the specified initial capacity.
 o LineVector(int, int)
Constructs an empty line vector with the specified initial capacity and capacity increment.

Method Index

 o addPoint(int, int)
Add a point to this vector.
 o addPoint(Point)
Add a point to this vector.
 o equals(LineVector)
 o firstPoint()
Get the first line point.
 o getPointAt(int)
Get the line point at the given offset.
 o isStraight()
Check if object describes a straight line.
 o lastPoint()
Get the last line point.

Constructors

 o LineVector
 public LineVector()
Construct an empty line vector.

 o LineVector
 public LineVector(int initialCapacity,
                   int capacityIncrement)
Constructs an empty line vector with the specified initial capacity and capacity increment.

Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - the amount by which the capacity is increased when the vector overflows.
 o LineVector
 public LineVector(int initialCapacity)
Constructs an empty line vector with the specified initial capacity.

Parameters:
initialCapacity - the initial capacity of the vector.

Methods

 o getPointAt
 public Point getPointAt(int idx)
Get the line point at the given offset.

Parameters:
idx - the index of the line point to return (0 is the first point)
Returns:
the line point at the specified index
 o firstPoint
 public Point firstPoint() throws NoSuchElementException
Get the first line point.

Returns:
the first line point
 o lastPoint
 public Point lastPoint() throws NoSuchElementException
Get the last line point.

Returns:
the last line point
 o addPoint
 public void addPoint(Point pt)
Add a point to this vector.

Parameters:
pt - the point to be added
 o addPoint
 public void addPoint(int x,
                      int y)
Add a point to this vector.

Parameters:
x - the x-coordinate of the point to be added
y - the y-coordinate of the point to be added
 o equals
 public boolean equals(LineVector obj)
 o isStraight
 public boolean isStraight()
Check if object describes a straight line.

Returns:
true, if line is straight or there are less than 2 points.

All Packages  Class Hierarchy  This Package  Previous  Next  Index