org.apache.batik.parser
Class NumberParser

java.lang.Object
  |
  +--org.apache.batik.parser.AbstractParser
        |
        +--org.apache.batik.parser.NumberParser
All Implemented Interfaces:
Localizable, Parser
Direct Known Subclasses:
AngleParser, LengthParser, PathParser, PointsParser, TransformListParser

public abstract class NumberParser
extends AbstractParser

This class represents a parser with support for numbers.


Field Summary
protected  char[] buffer
          The buffer used for numbers.
protected  int bufferSize
          The buffer size.
 
Fields inherited from class org.apache.batik.parser.AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, inputBuffer, localizableSupport
 
Constructor Summary
NumberParser()
           
 
Method Summary
protected  void bufferize()
          Adds the current character to the buffer.
protected  java.lang.String getBufferContent()
          Returns the content of the buffer.
protected  float parseFloat()
          Parses the content of the buffer and converts it to a float.
protected abstract  void readNumber()
          Reads a number from the current stream and put it in the buffer.
 
Methods inherited from class org.apache.batik.parser.AbstractParser
createErrorMessage, formatMessage, getBundleClassName, getCurrent, getLocale, initialize, read, reportError, setErrorHandler, setLocale, skipCommaSpaces, skipSpaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.parser.Parser
parse
 

Field Detail

buffer

protected char[] buffer
The buffer used for numbers.

bufferSize

protected int bufferSize
The buffer size.
Constructor Detail

NumberParser

public NumberParser()
Method Detail

readNumber

protected abstract void readNumber()
                            throws ParseException
Reads a number from the current stream and put it in the buffer.

parseFloat

protected float parseFloat()
                    throws java.lang.NumberFormatException,
                           ParseException
Parses the content of the buffer and converts it to a float.

getBufferContent

protected java.lang.String getBufferContent()
Returns the content of the buffer.

bufferize

protected void bufferize()
Adds the current character to the buffer.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.