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
-
LineVector()
- Construct an empty line vector.
-
LineVector(int)
- Constructs an empty line vector with the specified initial capacity.
-
LineVector(int, int)
- Constructs an empty line vector with the specified initial capacity and
capacity increment.
-
addPoint(int, int)
- Add a point to this vector.
-
addPoint(Point)
- Add a point to this vector.
-
equals(LineVector)
-
-
firstPoint()
- Get the first line point.
-
getPointAt(int)
- Get the line point at the given offset.
-
isStraight()
- Check if object describes a straight line.
-
lastPoint()
- Get the last line point.
LineVector
public LineVector()
- Construct an empty line vector.
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.
LineVector
public LineVector(int initialCapacity)
- Constructs an empty line vector with the specified initial capacity.
- Parameters:
- initialCapacity - the initial capacity of the vector.
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
firstPoint
public Point firstPoint() throws NoSuchElementException
- Get the first line point.
- Returns:
- the first line point
lastPoint
public Point lastPoint() throws NoSuchElementException
- Get the last line point.
- Returns:
- the last line point
addPoint
public void addPoint(Point pt)
- Add a point to this vector.
- Parameters:
- pt - the point to be added
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
equals
public boolean equals(LineVector obj)
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