|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.units.Dimension
public abstract class Dimension
Provides support for the concept of "dimension": pairs of base entities and exponents.
Field Summary | |
---|---|
protected Factor[] |
_factors
The individual elements of this dimension. |
Constructor Summary | |
---|---|
|
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. |
Method Summary | |
---|---|
boolean |
equals(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. |
String |
toString()
Returns the string representation of this dimension. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Factor[] _factors
Constructor Detail |
---|
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.Method Detail |
---|
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(Object object)
equals
in class Object
object
- The object.
true
if and only if this dimension is semantically
identical to object
.public int hashCode()
hashCode
in class Object
public final boolean isDimensionless()
true
if and only if this dimension is dimensionless.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |