Inner class used to represent HTML string representations of doubles. More...

Public Member Functions | |
| HTMLStringRepresentation () | |
| The usual constructor. | |
| boolean | isOne () |
| Test whether this matches one. | |
| boolean | isMinusOne () |
| Test whether this matches minus 1. | |
Public Attributes | |
| final jscicalc.StringArray | string |
| A string to hold the HTML representation of the number. | |
| final int | length |
| A string to hold the length of the representation. | |
Private Member Functions | |
| HTMLStringRepresentation (jscicalc.StringArray string, int length) | |
| Constructor. | |
Inner class used to represent HTML string representations of doubles.
These are used to build up representations of complex numbers. The HTML allows us to format the minus sign and exponent nicely. It also allows us to use symbols for infinity. The HTML here does not include the usual start and end tags. These get added later when the number is formatted in Complex.toHTMLString().
The length is used to try to stop overflow in the output. Roughly digits and symbols in the output have about the same width. So this gives a good enough measure of width of output to create a reasonable representation.
| jscicalc.complex.DoubleFormat.HTMLStringRepresentation.HTMLStringRepresentation | ( | jscicalc.StringArray | string, | |
| int | length | |||
| ) | [private] |
Constructor.
This version is only used inside this class.
| string | The string representation | |
| length | Its length |
References jscicalc.complex.DoubleFormat.HTMLStringRepresentation.string.
| jscicalc.complex.DoubleFormat.HTMLStringRepresentation.HTMLStringRepresentation | ( | ) |
The usual constructor.
We call it indirectly through representation().
References jscicalc.complex.DoubleFormat.infinity, jscicalc.complex.DoubleFormat.HTMLStringRepresentation.length, jscicalc.complex.DoubleFormat.minusInfinity, jscicalc.complex.DoubleFormat.notation, jscicalc.complex.DoubleFormat.number, jscicalc.complex.DoubleFormat.scientific(), jscicalc.complex.DoubleFormat.standard(), jscicalc.Notation.standard(), and jscicalc.complex.DoubleFormat.HTMLStringRepresentation.string.
| boolean jscicalc.complex.DoubleFormat.HTMLStringRepresentation.isMinusOne | ( | ) |
Test whether this matches minus 1.
References jscicalc.complex.DoubleFormat.minus.
| boolean jscicalc.complex.DoubleFormat.HTMLStringRepresentation.isOne | ( | ) |
Test whether this matches one.
A string to hold the length of the representation.
This is not just the length of the string, but rather a rough character count, ignoring, for example, thin spaces and XML, and counting a minus sign as a single character.
Referenced by jscicalc.complex.DoubleFormat.HTMLStringRepresentation.HTMLStringRepresentation().
A string to hold the HTML representation of the number.
Referenced by jscicalc.complex.DoubleFormat.HTMLStringRepresentation.HTMLStringRepresentation().
1.7.1