Public Member Functions | Public Attributes | Private Member Functions

jscicalc.complex.DoubleFormat.HTMLStringRepresentation Class Reference

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

Collaboration diagram for jscicalc.complex.DoubleFormat.HTMLStringRepresentation:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

jscicalc.complex.DoubleFormat.HTMLStringRepresentation.HTMLStringRepresentation ( jscicalc.StringArray  string,
int  length 
) [private]

Constructor.

This version is only used inside this class.

Parameters:
string The string representation
length Its length

References jscicalc.complex.DoubleFormat.HTMLStringRepresentation.string.

jscicalc.complex.DoubleFormat.HTMLStringRepresentation.HTMLStringRepresentation (  ) 

Member Function Documentation

boolean jscicalc.complex.DoubleFormat.HTMLStringRepresentation.isMinusOne (  ) 

Test whether this matches minus 1.

Returns:
true or false according as this matches minus 1 or not

References jscicalc.complex.DoubleFormat.minus.

boolean jscicalc.complex.DoubleFormat.HTMLStringRepresentation.isOne (  ) 

Test whether this matches one.

Returns:
true or false according as this matches 1 or not

Member Data Documentation

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().


The documentation for this class was generated from the following file: