| java.lang.Object com.sun.perseus.parser.AbstractParser com.sun.perseus.parser.NumberParser
All known Subclasses: com.sun.perseus.parser.ViewBoxParser, com.sun.perseus.parser.TransformListParser, com.sun.perseus.parser.ColorParser, com.sun.perseus.parser.PathParser, com.sun.perseus.parser.NumberListParser, com.sun.perseus.parser.LengthParser,
NumberParser | public class NumberParser extends AbstractParser (Code) | | This class represents a parser with support for numbers. Note that
the parameter-less form of the parseNumber methods is meant
for use by subclasses (e.g., TransformListParser ).
version: $Id: NumberParser.java,v 1.2 2006/04/21 06:40:35 st125089 Exp $ |
Method Summary | |
public static float | buildFloat(int mant, int exp) Computes a float from mantissa and exponent. | public float | parseNumber(String numberString) Parses the content of the input String and converts it to a float. | public float | parseNumber() | public float | parseNumber(boolean eos) Parses the next float value in the string.
Parameters: eos - If eos is set to true, then there should be no morecharacters at the end of the string. |
buildFloat | public static float buildFloat(int mant, int exp)(Code) | | Computes a float from mantissa and exponent.
Parameters: mant - the mantissa for the floating point value to create Parameters: exp - the exponent for the floating point value to create a single precision floating point valuecorresponding to the input mantissa/exponentpair. |
parseNumber | public float parseNumber(String numberString)(Code) | | Parses the content of the input String and converts it to a float.
Parameters: numberString - the value to parse the corresponding single precision floating point value. |
parseNumber | public float parseNumber()(Code) | | Parses a float value from the current position in the string
floating point value corresponding to the parsed string. |
parseNumber | public float parseNumber(boolean eos)(Code) | | Parses the next float value in the string.
Parameters: eos - If eos is set to true, then there should be no morecharacters at the end of the string. floating point value corresponding to the parsed string.An IllegalArgumentException is thrown ifthe next number in the stringdoes not have a valid number syntax or if eos is trueand there are more characters in the string after thenumber. |
|
|