|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.MathType visad.ScalarType visad.RealType visad.data.netcdf.Quantity
public class Quantity
The following class represents a quantity -- usually a physical one such as energy, viscosity, or velocity (although an artificial one such as "money" should be possible). It extends RealType by carrying around a preferred unit as a string because a Unit is useless for doing that. A Quantity is immutable.
Field Summary | |
---|---|
protected String |
unitSpec
The specification of the preferred unit of the quantity. |
Fields inherited from class visad.RealType |
---|
Altitude, Declination, Generic, INTERVAL, Latitude, Longitude, Radius, RightAscension, Time, TimeInterval, XAxis, YAxis, ZAxis |
Constructor Summary | |
---|---|
Quantity(String name,
String unitSpec)
Constructs from a name and a unit specification. |
|
Quantity(String name,
String unitSpec,
SimpleSet set)
Constructs from a name, a unit specification, and a sample set. |
Method Summary | |
---|---|
String |
getDefaultUnitString()
Return the default unit of this quantity as a string. |
static Quantity |
getQuantity(String name,
String unitSpec)
create a new Quantity, or return it if it already exists |
static Quantity |
getQuantity(String name,
String unitSpec,
SimpleSet set)
create a new Quantity, or return it if it already exists |
static Quantity |
getQuantityByName(String name)
return any Quantity constructed in this JVM with name, or null |
Methods inherited from class visad.RealType |
---|
binary, buildShadowType, cloneDerivative, equals, equalsExceptName, equalsExceptNameButUnits, getAttributeMask, getDefaultSet, getDefaultUnit, getRealType, getRealType, getRealType, getRealType, getRealType, getRealType, getRealTypeByName, isInterval, main, missingData, prettyString, setDefaultSet, unary |
Methods inherited from class visad.ScalarType |
---|
alias, compareTo, getAlias, getName, getNameWithBlanks, getOriginalName, getScalarTypeByName, hashCode, readResolve, validateName |
Methods inherited from class visad.MathType |
---|
addTimeAlias, findScalarType, guessMaps, prettyString, stringToType, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final String unitSpec
Constructor Detail |
---|
public Quantity(String name, String unitSpec, SimpleSet set) throws VisADException, ParseException
name
- The name of the quantity (e.g. "length").unitSpec
- The preferred unit for the quantity
(e.g. "feet").set
- The default sample set for the quantity. May be
null
.
ParseException
- Couldn't decode unit specification.
VisADException
- ScalarType of same name already exists.public Quantity(String name, String unitSpec) throws VisADException, ParseException
name
- The name of the quantity (e.g. "length").unitSpec
- The preferred unit for the quantity
(e.g. "feet").
VisADException
- Can't create necessary VisAD object.
ParseException
- Couldn't decode unit specification.Method Detail |
---|
public String getDefaultUnitString()
null
if no such unit.public static Quantity getQuantity(String name, String unitSpec, SimpleSet set) throws ParseException
ParseException
public static Quantity getQuantity(String name, String unitSpec) throws ParseException
ParseException
public static Quantity getQuantityByName(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |