|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.units.UnitFormatImpl
ucar.units.StandardUnitFormat
public final class StandardUnitFormat
Standard formatter/parser for unit specifications.
| Field Summary | |
|---|---|
Token |
jj_nt
|
boolean |
lookingAhead
|
Token |
token
|
StandardUnitFormatTokenManager |
token_source
|
| Fields inherited from interface ucar.units.StandardUnitFormatConstants |
|---|
DEFAULT, DIVIDE, E, EOF, LETTER, NAME, PER, SHIFT, SINCE, SYMBOL, T, tokenImage, UINT, UTC, WHITESPACE, Z |
| Constructor Summary | |
|---|---|
StandardUnitFormat(java.io.InputStream stream)
|
|
StandardUnitFormat(java.io.Reader stream)
|
|
StandardUnitFormat(StandardUnitFormatTokenManager tm)
|
|
| Method Summary | |
|---|---|
void |
disable_tracing()
|
void |
enable_tracing()
|
java.lang.StringBuffer |
format(Factor factor,
java.lang.StringBuffer buf)
Formats a Factor. |
java.lang.StringBuffer |
format(Unit unit,
java.lang.StringBuffer buf)
Formats a unit. |
ParseException |
generateParseException()
|
Token |
getNextToken()
|
Token |
getToken(int index)
|
static StandardUnitFormat |
instance()
Returns an instance of this class. |
int |
integer()
|
java.lang.StringBuffer |
longFormat(Unit unit,
java.lang.StringBuffer buf)
Formats a unit in the underlying system of units. |
static void |
main(java.lang.String[] args)
Test this class. |
double |
number()
|
double |
numericalOriginExpression()
|
Unit |
parse(java.lang.String spec,
UnitDB unitDB)
Decodes a unit specification. |
int |
powerExpression()
|
void |
ReInit(java.io.InputStream stream)
|
void |
ReInit(java.io.Reader stream)
|
void |
ReInit(StandardUnitFormatTokenManager tm)
|
int |
sign()
|
java.util.Date |
timeOriginExpression()
|
Unit |
unitFactor(UnitDB unitDB)
|
Unit |
unitIdentifier(UnitDB unitDB)
|
Unit |
unitSpec(UnitDB unitDB)
|
Unit |
unitTerm(UnitDB unitDB)
|
double |
unsignedDecimal()
|
int |
unsignedInteger()
|
| Methods inherited from class ucar.units.UnitFormatImpl |
|---|
format, format, longFormat, parse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public StandardUnitFormatTokenManager token_source
public Token token
public Token jj_nt
public boolean lookingAhead
| Constructor Detail |
|---|
public StandardUnitFormat(java.io.InputStream stream)
public StandardUnitFormat(java.io.Reader stream)
public StandardUnitFormat(StandardUnitFormatTokenManager tm)
| Method Detail |
|---|
public static StandardUnitFormat instance()
public Unit parse(java.lang.String spec,
UnitDB unitDB)
throws UnitParseException,
SpecificationException,
UnitDBException,
PrefixDBException,
UnitSystemException
parse in interface UnitFormatspec - The unit specification to be decoded.unitDB - The unit database to use.
UnitParseException - The unit specification syntax is
invalid.
SpecificationException - Something's wrong with the
specification.
UnitDBException - Something's wrong with the unit
database.
PrefixDBException - Something's wrong with the unit prefix
database.
UnitSystemException - Something's wrong with the underlying
system of units.
public java.lang.StringBuffer format(Factor factor,
java.lang.StringBuffer buf)
format in interface UnitFormatfactor - The factor to be formatted.buf - The buffer to append to.
public java.lang.StringBuffer format(Unit unit,
java.lang.StringBuffer buf)
throws UnitClassException
format in interface UnitFormatunit - The unit to be formatted.buf - The buffer to append to.
UnitClassException - The class of the unit is unknown.
public java.lang.StringBuffer longFormat(Unit unit,
java.lang.StringBuffer buf)
throws UnitClassException
longFormat in interface UnitFormatunit - The unit to be formatted.buf - The buffer to append to.
UnitClassException - The class of the unit is unknown.
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
public final Unit unitSpec(UnitDB unitDB)
throws ParseException,
OperationException,
UnitSystemException,
PrefixDBException,
UnitDBException
ParseException
OperationException
UnitSystemException
PrefixDBException
UnitDBException
public final Unit unitTerm(UnitDB unitDB)
throws ParseException,
OperationException,
UnitSystemException,
PrefixDBException,
UnitDBException
ParseException
OperationException
UnitSystemException
PrefixDBException
UnitDBException
public final Unit unitFactor(UnitDB unitDB)
throws ParseException,
OperationException,
UnitSystemException,
PrefixDBException,
UnitDBException
ParseException
OperationException
UnitSystemException
PrefixDBException
UnitDBException
public final double numericalOriginExpression()
throws ParseException
ParseException
public final double number()
throws ParseException
ParseException
public final int integer()
throws ParseException
ParseException
public final int sign()
throws ParseException
ParseException
public final int unsignedInteger()
throws ParseException
ParseException
public final double unsignedDecimal()
throws ParseException
ParseException
public final int powerExpression()
throws ParseException
ParseException
public final Unit unitIdentifier(UnitDB unitDB)
throws ParseException,
UnitDBException,
UnitSystemException,
PrefixDBException
ParseException
UnitDBException
UnitSystemException
PrefixDBException
public final java.util.Date timeOriginExpression()
throws ParseException
ParseExceptionpublic void ReInit(java.io.InputStream stream)
public void ReInit(java.io.Reader stream)
public void ReInit(StandardUnitFormatTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||