public class EnumerationUnits extends Units
ampRatio, bytes, bytesPerSecond, cdfEpoch, cdfTT2000, celciusDegrees, centigrade, centimeters, cm_2s_1keV_1, cm_2s_1MeV_1, cmps, days, dB, decimalYear, deg, degrees, degrees2, dimensionless, dollars, euros, ev, eV, fahrenheitDegrees, fahrenheitScale, gigaHertz, hertz, hours, hours2, inches, julianDay, kelvin, keV, kiloBytes, kiloBytesPerSecond, kiloHertz, kiloMeters, log10Ratio, logERatio, megaHertz, meters, MeV, microseconds, microseconds2, microseconds3, millimeters, milliseconds, milliseconds2, minutes, mj1958, mjd, mps, ms1970, nanoseconds, ns, nT, pcm3, percent, percentIncrease, picoseconds, radians, rgbColor, rupee, seconds, seconds2, t1970, t2000, t2010, typographicPoints, us1970, us1980, us2000, us2020, v2pm2Hz, wpm2, years, yen| Constructor and Description |
|---|
EnumerationUnits(java.lang.String id) |
EnumerationUnits(java.lang.String id,
java.lang.String description) |
| Modifier and Type | Method and Description |
|---|---|
Datum |
add(java.lang.Number a,
java.lang.Number b,
Units bUnits) |
double |
convertDoubleTo(Units toUnits,
double value)
convert the double in this units' space to toUnits' space.
|
static EnumerationUnits |
create(java.lang.Object o)
create the enumeration unit with the given context.
|
Datum |
createDatum(Datum value)
create a Datum with the units.
|
Datum |
createDatum(double d) |
Datum |
createDatum(double d,
double resolution) |
Datum |
createDatum(int value) |
Datum |
createDatum(int ival,
java.lang.Object sval)
creates the datum, explicitly setting the ordinal.
|
Datum |
createDatum(int ival,
java.lang.Object sval,
int color)
creates the datum, explicitly setting the ordinal.
|
Datum |
createDatum(long value) |
Datum |
createDatum(java.lang.Number value) |
Datum |
createDatum(java.lang.Object object)
return the Datum that represents this object, or create a Datum for
the object.
|
static Datum |
createDatumAndUnits(java.lang.Object object) |
DatumVector |
createDatumVector(java.lang.Object[] objects) |
Datum |
divide(java.lang.Number a,
java.lang.Number b,
Units bUnits) |
int |
getColor(Datum d)
return color suggestion for this value.
|
DatumFormatterFactory |
getDatumFormatterFactory()
return the formatter factor for this Datum.
|
Datum |
getFillDatum()
return the datum for ""
|
double |
getFillDouble()
return the double for ""
|
int |
getHighestOrdinal() |
java.lang.Object |
getObject(Datum datum)
return the object (typically a string) associated with this Datum
|
java.util.Map<java.lang.Integer,Datum> |
getValues()
provides access to map of all values.
|
boolean |
hasFillDatum()
true if fill has been defined, which is the empty string or all spaces.
|
boolean |
isFill(java.lang.Number value) |
Datum |
multiply(java.lang.Number a,
java.lang.Number b,
Units bUnits) |
Datum |
parse(java.lang.String s)
parse the string in the context of these units.
|
Datum |
subtract(java.lang.Number a,
java.lang.Number b,
Units bUnits) |
java.lang.String |
toString() |
format, getAllUnits, getBasis, getByName, getCanonicalUnit, getConverter, getConverter, getConvertibleUnits, getId, getOffsetUnits, grannyFormat, isConvertibleTo, isFill, isValid, lookupTimeLengthUnit, lookupTimeUnits, lookupTimeUnits, lookupUnits, main, nominal, nominal, registerConverterpublic EnumerationUnits(java.lang.String id)
public EnumerationUnits(java.lang.String id,
java.lang.String description)
public static Datum createDatumAndUnits(java.lang.Object object)
public Datum createDatum(int ival, java.lang.Object sval, int color)
ival - the integer value of the datumsval - the object to associate. This can be an object for legacy reasons, but should be a String.color - RGB color to associate with this value.java.lang.IllegalArgumentException - if this ordinal is already taken by a different value.public int getColor(Datum d)
d - the datumpublic Datum createDatum(int ival, java.lang.Object sval)
ival - the integer value of the datumsval - the object to associate. This can be an object for legacy reasons.java.lang.IllegalArgumentException - if this ordinal is already taken by a different value.public DatumVector createDatumVector(java.lang.Object[] objects)
public boolean hasFillDatum()
public Datum createDatum(java.lang.Object object)
object - an object, typically a string.createDatum( Datum )public java.util.Map<java.lang.Integer,Datum> getValues()
public Datum createDatum(int value)
createDatum in class Unitspublic Datum createDatum(long value)
createDatum in class Unitspublic Datum createDatum(java.lang.Number value)
createDatum in class Unitspublic java.lang.Object getObject(Datum datum)
datum - public static EnumerationUnits create(java.lang.Object o)
o - public Datum createDatum(double d)
createDatum in class Unitspublic Datum createDatum(double d, double resolution)
createDatum in class Unitspublic DatumFormatterFactory getDatumFormatterFactory()
UnitsgetDatumFormatterFactory in class Unitspublic Datum parse(java.lang.String s) throws java.text.ParseException
Unitspublic int getHighestOrdinal()
public double getFillDouble()
getFillDouble in class Unitspublic Datum getFillDatum()
getFillDatum in class Unitspublic double convertDoubleTo(Units toUnits, double value)
UnitsconvertDoubleTo in class UnitstoUnits - the units.value - the value in toUnits.public Datum createDatum(Datum value)
UnitscreateDatum in class Units