class EBNFHelper
extends java.lang.Object
EBNFUnitFormat| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
ADDITION_PRECEDENCE
Operator precedence for the addition and subtraction operations
|
private static char |
EXPONENT_1
Exponent 1 character
|
private static char |
EXPONENT_2
Exponent 2 character
|
(package private) static int |
EXPONENT_PRECEDENCE
Operator precedence for the exponentiation and logarithm operations
|
(package private) static char |
MIDDLE_DOT |
(package private) static int |
NOOP_PRECEDENCE
Operator precedence for a unit identifier containing no mathematical operations (i.e., consisting exclusively of an identifier and possibly a
prefix).
|
(package private) static int |
PRODUCT_PRECEDENCE
Operator precedence for the multiplication and division operations
|
| Constructor and Description |
|---|
EBNFHelper() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
formatExponent(javax.measure.Unit<?> unit,
int pow,
int root,
boolean continued,
java.lang.Appendable buffer,
SymbolMap symbolMap)
Format the given unit raised to the given fractional power to the given
StringBuffer. |
(package private) static int |
formatInternal(javax.measure.Unit<?> unit,
java.lang.Appendable buffer,
SymbolMap symbolMap)
Format the given unit to the given StringBuffer, then return the operator precedence of the outermost operator in the unit expression that was
formatted.
|
private static int |
newUnitPrecedenceInternal(javax.measure.Unit<?> unit,
java.lang.Appendable buffer,
SymbolMap symbolMap) |
private static int |
noopPrecedenceInternal(java.lang.Appendable buffer,
java.lang.String symbol) |
private static int |
productPrecedenceInternal(javax.measure.Unit<?> unit,
java.lang.Appendable buffer,
SymbolMap symbolMap) |
static final int ADDITION_PRECEDENCE
static final int PRODUCT_PRECEDENCE
static final int EXPONENT_PRECEDENCE
static final char MIDDLE_DOT
private static final char EXPONENT_1
private static final char EXPONENT_2
static final int NOOP_PRECEDENCE
Integer.MAX_VALUE so that no operator can have a higher precedence.static int formatInternal(javax.measure.Unit<?> unit,
java.lang.Appendable buffer,
SymbolMap symbolMap)
throws java.io.IOException
ConverterFormat for the constants that define the various precedence values.unit - the unit to be formattedbuffer - the StringBuffer to be written tojava.io.IOExceptionprivate static void formatExponent(javax.measure.Unit<?> unit,
int pow,
int root,
boolean continued,
java.lang.Appendable buffer,
SymbolMap symbolMap)
throws java.io.IOException
StringBuffer.unit - Unit the unit to be formattedpow - int the numerator of the fractional powerroot - int the denominator of the fractional powercontinued - boolean true if the converter expression should begin with an operator, otherwise false. This will always be
true unless the unit being modified is equal to Unit.ONE.buffer - StringBuffer the buffer to append to. No assumptions should be made about its content.java.io.IOExceptionprivate static int noopPrecedenceInternal(java.lang.Appendable buffer,
java.lang.String symbol)
throws java.io.IOException
java.io.IOExceptionprivate static int productPrecedenceInternal(javax.measure.Unit<?> unit,
java.lang.Appendable buffer,
SymbolMap symbolMap)
throws java.io.IOException
java.io.IOExceptionprivate static int newUnitPrecedenceInternal(javax.measure.Unit<?> unit,
java.lang.Appendable buffer,
SymbolMap symbolMap)
throws java.io.IOException
java.io.IOException