Class Point

java.lang.Object
  extended byPoint
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
PointN

public abstract class Point
extends java.lang.Object
implements java.lang.Cloneable

Point is an abstract class which can be used to store any dimensional system. A mathematical operation on a Point; add, multiply, and abs, can be performed using instance or static methods.


Constructor Summary
Point()
           
 
Method Summary
abstract  void abs()
          Instance method to calculate the absolute value of the Point, abstract and must be defined by any subclasses of Point.
static Point abs(Point p)
          Static method to calculate and return a new Point equal to the absolute value of the Point p.
abstract  void add(Point delta)
          Instance method to add a Point to the current Point, abstract and must be defined by any subclasses of Point.
static Point add(Point a, Point b)
          Static method to add two Points.
static Point add(Point a, Point b, Point c)
          Static method to add three Points.
static Point add(Point a, Point b, Point c, Point d)
          Static method to add four Points.
 java.lang.Object clone()
          Overrides the object.clone() method to enable Point cloning outside of Point package.
abstract  double coordinate(int i)
          Instance method to return the coordinate of the Point at index i, abstract and must be defined by any subclasses of Point.
abstract  int dimension()
          Instance method to return the dimension of the Point, abstract and must be defined by any subclasses of Point.
abstract  double max()
          Method to return the maximum of the Point, abstract and must be defined by any subclasses of Point.
abstract  double min()
          Method to return the minimum of the Point, abstract and must be defined by any subclasses of Point.
abstract  void multiply(double c)
          Instance method to multiply the current Point by a double, abstract and must be defined by any subclasses of Point.
static Point multiply(Point p, double c)
          Static method to multiply a Point by a double.
abstract  void round(int n)
          Instance method to round the Point's accuracy to n decimal places, abstract and must be defined by any subclasses of Point.
abstract  java.lang.String toString()
          Instance method to return the contents of the Point in human readable form, abstract and must be defined by any subclasses of Point.
abstract  void truncate(int n)
          Instance method to truncate the Point's accuracy to n decimal places, abstract and must be defined by any subclasses of Point.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point

public Point()
Method Detail

dimension

public abstract int dimension()
Instance method to return the dimension of the Point, abstract and must be defined by any subclasses of Point.


coordinate

public abstract double coordinate(int i)
Instance method to return the coordinate of the Point at index i, abstract and must be defined by any subclasses of Point.


add

public abstract void add(Point delta)
Instance method to add a Point to the current Point, abstract and must be defined by any subclasses of Point.


multiply

public abstract void multiply(double c)
Instance method to multiply the current Point by a double, abstract and must be defined by any subclasses of Point.


max

public abstract double max()
Method to return the maximum of the Point, abstract and must be defined by any subclasses of Point.


min

public abstract double min()
Method to return the minimum of the Point, abstract and must be defined by any subclasses of Point.


abs

public abstract void abs()
Instance method to calculate the absolute value of the Point, abstract and must be defined by any subclasses of Point.


toString

public abstract java.lang.String toString()
Instance method to return the contents of the Point in human readable form, abstract and must be defined by any subclasses of Point.


truncate

public abstract void truncate(int n)
Instance method to truncate the Point's accuracy to n decimal places, abstract and must be defined by any subclasses of Point.


round

public abstract void round(int n)
Instance method to round the Point's accuracy to n decimal places, abstract and must be defined by any subclasses of Point.


clone

public java.lang.Object clone()
Overrides the object.clone() method to enable Point cloning outside of Point package.


multiply

public static Point multiply(Point p,
                             double c)
Static method to multiply a Point by a double.


add

public static Point add(Point a,
                        Point b)
Static method to add two Points.


add

public static Point add(Point a,
                        Point b,
                        Point c)
Static method to add three Points.


add

public static Point add(Point a,
                        Point b,
                        Point c,
                        Point d)
Static method to add four Points.


abs

public static Point abs(Point p)
Static method to calculate and return a new Point equal to the absolute value of the Point p.