fsmvis.engine
Class Coordinate

java.lang.Object
  |
  +--fsmvis.engine.Coordinate
Direct Known Subclasses:
Vect

public class Coordinate
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static int activeDimensions
           
static int INITIAL_DIMENSIONS
           
 double w
           
 double x
           
 double y
           
 double z
           
 
Constructor Summary
Coordinate()
          constructor: Takes no params and sets the initial values to be 0.0
Coordinate(Coordinate c)
          constructor: instantiate the coordinate with a new copy of an existing coordinate
Coordinate(double x, double y)
          constructor: takes two double values to represent the coords
Coordinate(double x, double y, double z)
          constructor: takes two double values to represent the coords
Coordinate(double x, double y, double z, double w)
          constructor: takes two double values to represent the coords
 
Method Summary
 void add(Vect v)
          Adds the components of the vector v onto this coordinate
 boolean equals(Coordinate c)
          Defines whether or not two coordinates are equal
 double get(int index)
           
static int getActiveDimensions()
          A static method to get the number of dimensions which are currently active or in use
 double getW()
          Returns the w value
 double getX()
          Returns the x value
 double getY()
          Returns the y value
 double getZ()
          Returns the z value
 void set(Coordinate c)
           
 void set(double x, double y, double z, double w)
          Sets the values of the coordinates
 void set(int index, double val)
           
static void setActiveDimensions(int activeD)
          A static method to set the number of active dimensions, must be between 0 and INITIAL_DIMENSIONS
 void setW(double w)
          Sets the w value
 void setX(double x)
          Sets the x value
 void setY(double y)
          Sets the y value
 void setZ(double z)
          Sets the z value
 void sub(Vect v)
          subtracts the components of the vector v from this coordinate
 java.lang.String toString()
          Turns the object into a String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public double x

y

public double y

z

public double z

w

public double w

activeDimensions

public static int activeDimensions

INITIAL_DIMENSIONS

public static final int INITIAL_DIMENSIONS
Constructor Detail

Coordinate

public Coordinate()
constructor: Takes no params and sets the initial values to be 0.0

Coordinate

public Coordinate(double x,
                  double y)
constructor: takes two double values to represent the coords
Parameters:
x - The x value of coord
y - The y value

Coordinate

public Coordinate(double x,
                  double y,
                  double z)
constructor: takes two double values to represent the coords
Parameters:
x - The x value of coord
y - The y value
z - THe z value

Coordinate

public Coordinate(double x,
                  double y,
                  double z,
                  double w)
constructor: takes two double values to represent the coords
Parameters:
x - The x value of coord
y - The y value
z - The z value#
w - The w value

Coordinate

public Coordinate(Coordinate c)
constructor: instantiate the coordinate with a new copy of an existing coordinate
Parameters:
c - Coordinate values to be used for instantiating
Method Detail

get

public double get(int index)

getX

public double getX()
Returns the x value
Returns:
The x value

getY

public double getY()
Returns the y value
Returns:
The y value

getZ

public double getZ()
Returns the z value
Returns:
The z value

getW

public double getW()
Returns the w value
Returns:
The w value

set

public void set(double x,
                double y,
                double z,
                double w)
Sets the values of the coordinates
Parameters:
x - The x value
y - The y value
z - The z value
w - The w value

set

public void set(Coordinate c)
Parameters:
c -  

set

public void set(int index,
                double val)
Parameters:
index -  
val -  

setX

public void setX(double x)
Sets the x value
Returns:
The x value

setY

public void setY(double y)
Sets the y value
Returns:
The y value

setZ

public void setZ(double z)
Sets the z value
Returns:
The z value

setW

public void setW(double w)
Sets the w value
Returns:
The w value

add

public void add(Vect v)
Adds the components of the vector v onto this coordinate
Parameters:
v - The vector to be added onto this coordinate

sub

public void sub(Vect v)
subtracts the components of the vector v from this coordinate
Parameters:
v - The vector to be added onto this coordinate

getActiveDimensions

public static int getActiveDimensions()
A static method to get the number of dimensions which are currently active or in use
Returns:
the number of active dimensions

setActiveDimensions

public static void setActiveDimensions(int activeD)
A static method to set the number of active dimensions, must be between 0 and INITIAL_DIMENSIONS
Parameters:
activeD - The number of dimensions that are currently in use

equals

public boolean equals(Coordinate c)
Defines whether or not two coordinates are equal
Parameters:
c - the coordinate to compare with
Returns:
the result of the equality

toString

public java.lang.String toString()
Turns the object into a String representation
Returns:
The string representation
Overrides:
toString in class java.lang.Object