visad
Class QuantityDimension
- java.lang.Object
-
- visad.QuantityDimension
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable
public final class QuantityDimension extends java.lang.Object implements java.io.Serializable, java.lang.ComparableThis class represents the dimension of a quantity. For example, consider a nonrelativistic particle of mass m in uniform motion which travels a distance l in a time t. Its velocity is v=l/t and its kinetic energy is E=mv2/2=ml2t-2/2. The dimension of E is dim E=ML2T-2 and the dimensional exponents are 1, 2, and -2. A QuantityDimension is immutable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description QuantityDimension()Constructs from nothing (i.e.QuantityDimension(QuantityDimension that)Constructs from another dimension of a quantity.QuantityDimension(Unit unit)Constructs from an existing Unit.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcompareTo(java.lang.Object obj)Compare this dimension of a quantity to another.QuantityDimensiondivide(QuantityDimension that)Divide this dimension of a quantity by another.booleanequals(java.lang.Object obj)Indicate whether or not this dimension of a quantity is the same as another.booleanisDimensionless()Indicate whether or not this dimension of a quantity is dimensionless.static voidmain(java.lang.String[] args)Test this class.QuantityDimensionmultiply(QuantityDimension that)Multiply this dimension of a quantity by another.QuantityDimensionraise(int power)Raise this dimension of a quantity by a power.java.lang.StringtoString()Return a string representation of this dimension of a quantity.
-
-
-
Constructor Detail
-
QuantityDimension
public QuantityDimension()
Constructs from nothing (i.e. constructs a dimensionless quantity).
-
QuantityDimension
public QuantityDimension(QuantityDimension that)
Constructs from another dimension of a quantity.
-
QuantityDimension
public QuantityDimension(Unit unit) throws UnitException
Constructs from an existing Unit.- Throws:
UnitException
-
-
Method Detail
-
compareTo
public int compareTo(java.lang.Object obj)
Compare this dimension of a quantity to another.- Specified by:
compareToin interfacejava.lang.Comparable
-
equals
public boolean equals(java.lang.Object obj)
Indicate whether or not this dimension of a quantity is the same as another.- Overrides:
equalsin classjava.lang.Object
-
raise
public QuantityDimension raise(int power)
Raise this dimension of a quantity by a power.
-
multiply
public QuantityDimension multiply(QuantityDimension that)
Multiply this dimension of a quantity by another.
-
divide
public QuantityDimension divide(QuantityDimension that)
Divide this dimension of a quantity by another.
-
isDimensionless
public boolean isDimensionless()
Indicate whether or not this dimension of a quantity is dimensionless.
-
toString
public java.lang.String toString()
Return a string representation of this dimension of a quantity.- Overrides:
toStringin classjava.lang.Object
-
main
public static void main(java.lang.String[] args)
Test this class.
-
-
DMelt 3.0 © DataMelt by jWork.ORG