Classes | Static Public Member Functions | Static Public Attributes | Static Private Member Functions

jscicalc.ParseBase Class Reference

This class is designed to convert a string in base Base.BINARY, Base.OCTAL, Base.HEXADECIMAL into a jscicalc.complex.Complex. More...

List of all members.

Classes

class  Number
 Private inner class used by ParseBase. More...

Static Public Member Functions

static Complex parseString (String s, Base b)
 This is the function that Parser actually uses.
static double dparseString (String s, Base b)
 This is the function that Parser uses for doubles.
static void main (String[] args)

Static Public Attributes

static final long BIAS = 1023
 Standard constant for IEEE 754 doubles.
static final long E_MAX = 1023
 Standard constant for IEEE 754 doubles.
static final long E_MIN = -1022
 Standard constant for IEEE 754 doubles.

Static Private Member Functions

static long getDigit (char c)
 String is composed from Numeral PObject objects.

Detailed Description

This class is designed to convert a string in base Base.BINARY, Base.OCTAL, Base.HEXADECIMAL into a jscicalc.complex.Complex.

It also handles Base.DECIMAL by using a function in DOUBLE.

It was origainlly designed to convert a string in base Base.BINARY, Base.OCTAL, Base.HEXADECIMAL into a double. It also handles Base.DECIMAL by using a function in java.Math.BigDecimal. In fact it only needs to do this conversion because any number that we convert is a real or imaginary part, absolute value or argument.

When you enter an expression as a sequence of Numeral objects, Parser converts them to a string and then must convert the string to a double. This class does the conversion for Parser.

See also:
Parser
Author:
J. D. Lamb
Version:
Revision:
1.5

Member Function Documentation

static double jscicalc.ParseBase.dparseString ( String  s,
Base  b 
) [static]

This is the function that Parser uses for doubles.

Converts a string to a double in Base b.

Parameters:
s The string (a number composed from Numeral objects)
b The Base
Returns:
The number as a double
See also:
Parser

References jscicalc.ParseBase.BIAS, jscicalc.ParseBase.E_MAX, jscicalc.ParseBase.E_MIN, jscicalc.ParseBase.Number.exponent, jscicalc.ParseBase.Number.negative, and jscicalc.ParseBase.Number.significand.

Referenced by jscicalc.ParseBase.parseString().

static long jscicalc.ParseBase.getDigit ( char  c  )  [static, private]

String is composed from Numeral PObject objects.

Each contains a char and eventually we need to extract the char from a string and convert it into the corresponding integer

Parameters:
c a char representing a Numeral
Returns:
the corresponding integer

Referenced by jscicalc.ParseBase.Number.parseExponent(), and jscicalc.ParseBase.Number.parseSignificand().

static void jscicalc.ParseBase.main ( String[]  args  )  [static]
static Complex jscicalc.ParseBase.parseString ( String  s,
Base  b 
) [static]

This is the function that Parser actually uses.

Converts a string to a double in Base b.

Parameters:
s The string (a number composed from Numeral objects)
b The Base
Returns:
The number as a double
See also:
Parser

References jscicalc.ParseBase.dparseString().

Referenced by jscicalc.ParseBase.main().


Member Data Documentation

final long jscicalc.ParseBase.BIAS = 1023 [static]

Standard constant for IEEE 754 doubles.

Referenced by jscicalc.ParseBase.dparseString().

final long jscicalc.ParseBase.E_MAX = 1023 [static]

Standard constant for IEEE 754 doubles.

Referenced by jscicalc.ParseBase.dparseString().

final long jscicalc.ParseBase.E_MIN = -1022 [static]

Standard constant for IEEE 754 doubles.

Referenced by jscicalc.ParseBase.dparseString().


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