All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class units.Dimension

java.lang.Object
   |
   +----units.Dimension

public class Dimension
extends Object
implements Cloneable, Serializable
This class implements the vector u of exponents and its operations for addition, subtraction, and multiplication with a scalar.

Version:
$Id: Dimension.java,v 1.3 1998/09/02 17:54:03 schadow Exp $
Author:
Gunther Schadow

Constructor Index

 o Dimension()
 o Dimension(int)
Initializes a to the n-th base dimension.

Method Index

 o add(Dimension)
Adds to this dimension vector d1 another dimension vector d2, which is used when two units u1 and u2 are multiplied.
 o assign(Dimension)
 o assignZero()
 o clone()
 o elementAt(int)
Get n-th component.
 o equals(Dimension)
Tests for equality of this dimension d1 and another dimension d2.
 o getMax()
 o isZero()
Tests for zero dimension.
 o minus()
Inverts this dimension vector d.
 o mul(int)
Multiplies this dimension vector d with a scalar s, which is used when a unit is raised to a power.
 o setMax(int)
 o sub(Dimension)
Subtracts from this dimension vector d1 another dimension vector d2, which is used when two units u1 and u2 are divided.
 o toString()
Return a string that represents the vector

Constructors

 o Dimension
 public Dimension()
 o Dimension
 public Dimension(int n)
Initializes a to the n-th base dimension.

Methods

 o setMax
 public static void setMax(int n)
 o getMax
 public static int getMax()
 o elementAt
 public int elementAt(int n)
Get n-th component.

 o toString
 public String toString()
Return a string that represents the vector

Returns:
the string that represents the vector
Overrides:
toString in class Object
 o add
 public Dimension add(Dimension d2)
Adds to this dimension vector d1 another dimension vector d2, which is used when two units u1 and u2 are multiplied.

Returns:
the sum d1 + d2.
 o sub
 public Dimension sub(Dimension d2)
Subtracts from this dimension vector d1 another dimension vector d2, which is used when two units u1 and u2 are divided.

Returns:
the difference d1 - d2.
 o minus
 public Dimension minus()
Inverts this dimension vector d.

Returns:
-d.
 o mul
 public Dimension mul(int s)
Multiplies this dimension vector d with a scalar s, which is used when a unit is raised to a power.

Returns:
the product d1 * s.
 o equals
 public boolean equals(Dimension d2)
Tests for equality of this dimension d1 and another dimension d2.

Returns:
true if d1 and d2 are equal, false otherwise.
 o assign
 public Dimension assign(Dimension d)
 o assignZero
 public Dimension assignZero()
 o isZero
 public boolean isZero()
Tests for zero dimension.

Returns:
true if exponents are all zero, false otherwise.
 o clone
 public Object clone()
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index