public final class StandardUnitFormat extends UnitFormatImpl implements StandardUnitFormatConstants
Modifier and Type | Field and Description |
---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
StandardUnitFormatTokenManager |
token_source
Generated Token Manager.
|
Constructor and Description |
---|
StandardUnitFormat(java.io.InputStream stream)
Constructor with InputStream.
|
StandardUnitFormat(java.io.InputStream stream,
java.lang.String encoding)
Constructor with InputStream and supplied encoding
|
StandardUnitFormat(java.io.Reader stream)
Constructor.
|
StandardUnitFormat(StandardUnitFormatTokenManager tm)
Constructor with generated Token Manager.
|
Modifier and Type | Method and Description |
---|---|
Unit |
basicExpr(UnitDB unitDB) |
java.util.Calendar |
clockExpr(java.util.Calendar calendar) |
java.util.Calendar |
dateExpr() |
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
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()
Generate ParseException.
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
static StandardUnitFormat |
instance()
Returns an instance of this class.
|
int |
integer() |
Unit |
logExpr(UnitDB unitDB) |
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() |
Unit |
parse(java.lang.String spec,
UnitDB unitDB)
Decodes a unit specification.
|
Unit |
powerExpr(UnitDB unitDB) |
Unit |
productExpr(UnitDB unitDB) |
double |
real() |
void |
ReInit(java.io.InputStream stream)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream,
java.lang.String encoding)
Reinitialise.
|
void |
ReInit(java.io.Reader stream)
Reinitialise.
|
void |
ReInit(StandardUnitFormatTokenManager tm)
Reinitialise.
|
Unit |
shiftExpr(UnitDB unitDB) |
int |
sign() |
double |
tenFactor() |
java.util.Date |
timeOriginExpr() |
Unit |
unitIdentifier(UnitDB unitDB) |
Unit |
unitSpec(UnitDB unitDB) |
double |
unsignedDecimal() |
int |
unsignedInteger() |
java.util.Calendar |
zoneExpr(java.util.Calendar calendar) |
format, format, longFormat, parse
public StandardUnitFormatTokenManager token_source
public Token token
public Token jj_nt
public StandardUnitFormat(java.io.InputStream stream)
public StandardUnitFormat(java.io.InputStream stream, java.lang.String encoding)
public StandardUnitFormat(java.io.Reader stream)
public StandardUnitFormat(StandardUnitFormatTokenManager tm)
public static StandardUnitFormat instance()
public Unit parse(java.lang.String spec, UnitDB unitDB) throws UnitParseException, SpecificationException, UnitDBException, PrefixDBException, UnitSystemException
parse
in interface UnitFormat
spec
- 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 UnitFormat
factor
- 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 UnitFormat
unit
- 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 UnitFormat
unit
- 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
public final Unit shiftExpr(UnitDB unitDB) throws ParseException, OperationException, UnitSystemException, PrefixDBException, UnitDBException
public final Unit productExpr(UnitDB unitDB) throws ParseException, OperationException, UnitSystemException, PrefixDBException, UnitDBException
public final Unit powerExpr(UnitDB unitDB) throws ParseException, OperationException, UnitSystemException, PrefixDBException, UnitDBException
public final Unit basicExpr(UnitDB unitDB) throws ParseException, OperationException, UnitSystemException, PrefixDBException, UnitDBException
public final Unit logExpr(UnitDB unitDB) throws ParseException, OperationException, UnitSystemException, PrefixDBException, UnitDBException
public final double number() throws ParseException
ParseException
public final double real() throws ParseException
ParseException
public final int sign() throws ParseException
ParseException
public final double unsignedDecimal() throws ParseException
ParseException
public final double tenFactor() throws ParseException
ParseException
public final int integer() throws ParseException
ParseException
public final int unsignedInteger() throws ParseException
ParseException
public final Unit unitIdentifier(UnitDB unitDB) throws ParseException, UnitDBException, UnitSystemException, PrefixDBException, OperationException
public final java.util.Date timeOriginExpr() throws ParseException
ParseException
public final java.util.Calendar dateExpr() throws ParseException
ParseException
public final java.util.Calendar clockExpr(java.util.Calendar calendar) throws ParseException
ParseException
public final java.util.Calendar zoneExpr(java.util.Calendar calendar) throws ParseException
ParseException
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
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()