|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rubecula.jquantity.Dimensions
The public class Dimensions represents pure dimensional information - no scaling or other information.
This class needs work.
Field Summary | |
private long[] |
_Dimensions
Private instance field consisting of an array of longs in which to store the dimension values. |
private static int |
$MaxHashDims
|
static String[] |
$S_DIM_CODES
Letter codes for each of the dimensions. |
static String[] |
$S_DIM_IDS
String identifiers for each of the dimensions. |
Constructor Summary | |
protected |
Dimensions()
Empty constructor for Dimensions |
protected |
Dimensions(Dimensions that)
|
protected |
Dimensions(int dimension)
|
protected |
Dimensions(long[] dimensions)
General constructor for Dimensions |
Method Summary | |
private static long |
_gcd(long a,
long b)
|
boolean |
equals(Dimensions other)
Tests whether the dimensions are actually equal. |
(package private) long |
GCD(long a,
long b)
|
static int |
GetDimensionFromHashCode(int hashCode,
int index)
|
int |
getDimensions()
|
static Dimensions |
GetDimensionsFromHashCode(int hashCode)
|
Rational |
getPower(int dimension)
|
int |
hashCode()
This method generates a hash code of up to 30-bits for this object. |
(package private) Dimensions |
intersect(Dimensions that)
Method to intersect two dimensions objects. |
boolean |
isEqual(Dimensions other)
Return true if the Dimensions are equivalent. |
(package private) boolean |
isNumber()
|
static void |
main(String[] args)
|
(package private) Dimensions |
minus()
|
(package private) int |
norm()
|
(package private) void |
normalize()
|
(package private) Dimensions |
productScalar(Rational power)
|
(package private) Dimensions |
scale(int factor)
|
private void |
show(String tag)
|
(package private) Dimensions |
sum(Dimensions that)
|
String |
toString()
|
(package private) String |
toString(int index)
Method to yield a string representation of the index(th) dimension (or null if dimension 0). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final int $MaxHashDims
private long[] _Dimensions
public static final String[] $S_DIM_IDS
SIUnit
public static final String[] $S_DIM_CODES
SIUnit
Constructor Detail |
protected Dimensions(long[] dimensions) throws JQuantityException
dimensions
- an array of dimension values in the order defined by:
the first element is the divisor;
followed by dimensions in length,mass,time, etc.
JQuantityException
protected Dimensions()
protected Dimensions(int dimension)
protected Dimensions(Dimensions that)
Method Detail |
final Dimensions productScalar(Rational power)
final Dimensions scale(int factor)
final Dimensions sum(Dimensions that)
final Dimensions minus()
final boolean isNumber()
public final int hashCode()
public static int GetDimensionFromHashCode(int hashCode, int index)
public static Dimensions GetDimensionsFromHashCode(int hashCode) throws JQuantityException
JQuantityException
final void normalize()
public boolean equals(Dimensions other)
other
- Dimensions: the dimensions to compare with.
public boolean isEqual(Dimensions other)
other
- Dimensions: the dimensions to comare with.
final String toString(int index) throws JQuantityException
index
- the position of the dimension where index >= 1.
JQuantityException
public final String toString()
private static final long _gcd(long a, long b)
final long GCD(long a, long b) throws JQuantityException
JQuantityException
final Dimensions intersect(Dimensions that)
that
- the intersecting object.
final int norm()
private void show(String tag)
public static void main(String[] args)
public int getDimensions()
public Rational getPower(int dimension)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |