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
-
Dimension()
-
-
Dimension(int)
- Initializes a to the n-th base dimension.
-
add(Dimension)
- Adds to this dimension vector d1 another dimension vector
d2, which is used when two units u1 and u2 are multiplied.
-
assign(Dimension)
-
-
assignZero()
-
-
clone()
-
-
elementAt(int)
- Get n-th component.
-
equals(Dimension)
- Tests for equality of this dimension d1 and another dimension d2.
-
getMax()
-
-
isZero()
- Tests for zero dimension.
-
minus()
- Inverts this dimension vector d.
-
mul(int)
- Multiplies this dimension vector d with a scalar s, which is used
when a unit is raised to a power.
-
setMax(int)
-
-
sub(Dimension)
- Subtracts from this dimension vector d1 another dimension
vector d2, which is used when two units u1 and u2 are
divided.
-
toString()
- Return a string that represents the vector
Dimension
public Dimension()
Dimension
public Dimension(int n)
- Initializes a to the n-th base dimension.
setMax
public static void setMax(int n)
getMax
public static int getMax()
elementAt
public int elementAt(int n)
- Get n-th component.
toString
public String toString()
- Return a string that represents the vector
- Returns:
- the string that represents the vector
- Overrides:
- toString in class Object
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.
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.
minus
public Dimension minus()
- Inverts this dimension vector d.
- Returns:
- -d.
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.
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.
assign
public Dimension assign(Dimension d)
assignZero
public Dimension assignZero()
isZero
public boolean isZero()
- Tests for zero dimension.
- Returns:
- true if exponents are all zero, false otherwise.
clone
public Object clone()
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index