public abstract class Dimension
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Factor[] |
_factors
The individual elements of this dimension.
|
Modifier | Constructor and Description |
---|---|
|
Dimension()
Constructs a dimensionless dimension from nothing.
|
protected |
Dimension(Factor factor)
Constructs from a single Factor.
|
protected |
Dimension(Factor[] factors)
Constructs from an array of Factor-s.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Indicates if this dimension is semantically identical to an object.
|
Factor[] |
getFactors()
Returns the array of Factor-s constituting this dimension.
|
int |
getRank()
Returns the rank of this dimension.
|
int |
hashCode()
Returns the hash code of this instance.
|
boolean |
isDimensionless()
Indicates if this dimension is dimensionless.
|
boolean |
isReciprocalOf(Dimension that)
Indicates if this Dimension is the reciprocal of another dimension.
|
protected Factor[] |
mult(Dimension that)
Multiplies this dimension by another dimension.
|
protected Factor[] |
pow(int power)
Raises this dimension to a power.
|
java.lang.String |
toString()
Returns the string representation of this dimension.
|
protected final Factor[] _factors
public Dimension()
protected Dimension(Factor factor)
factor
- The single Factor that defines the dimension.protected Dimension(Factor[] factors)
factors
- The factors that define the dimension.public final int getRank()
public final Factor[] getFactors()
protected Factor[] mult(Dimension that)
that
- The other dimension.protected Factor[] pow(int power)
power
- The power to raise this dimension by.power
.public final boolean isReciprocalOf(Dimension that)
that
- The other dimension.true
if and only if this dimension is the reciprocal
of the other dimension.public final boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The object.true
if and only if this dimension is semantically
identical to object
.public int hashCode()
hashCode
in class java.lang.Object
public final boolean isDimensionless()
true
if and only if this dimension is dimensionless.public java.lang.String toString()
toString
in class java.lang.Object