org.apache.batik.parser
Class FloatArrayProducer

java.lang.Object
  extended by org.apache.batik.parser.DefaultNumberListHandler
      extended by org.apache.batik.parser.FloatArrayProducer
All Implemented Interfaces:
NumberListHandler, PointsHandler

public class FloatArrayProducer
extends DefaultNumberListHandler
implements PointsHandler

A handler class that generates an array of floats from parsing a number list or a point list.


Field Summary
protected  float[] a
          The current float[] object.
protected  LinkedList as
          List of float[] objects.
protected  int count
          The total number of floats accumulated.
protected  int index
          The index in which to store the next number.
 
Fields inherited from class org.apache.batik.parser.DefaultNumberListHandler
INSTANCE
 
Constructor Summary
FloatArrayProducer()
           
 
Method Summary
 void endNumberList()
          Invoked when the number list attribute ends.
 void endPoints()
          Implements PointsHandler.endPoints().
 float[] getFloatArray()
          Returns the array of floats accumulated.
 void numberValue(float v)
          Invoked when a float value has been parsed.
 void point(float x, float y)
          Implements PointsHandler.point(float,float).
 void startNumberList()
          Invoked when the number list attribute starts.
 void startPoints()
          Implements PointsHandler.startPoints().
 
Methods inherited from class org.apache.batik.parser.DefaultNumberListHandler
endNumber, startNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

as

protected LinkedList as
List of float[] objects.


a

protected float[] a
The current float[] object.


index

protected int index
The index in which to store the next number.


count

protected int count
The total number of floats accumulated.

Constructor Detail

FloatArrayProducer

public FloatArrayProducer()
Method Detail

getFloatArray

public float[] getFloatArray()
Returns the array of floats accumulated.


startNumberList

public void startNumberList()
                     throws ParseException
Invoked when the number list attribute starts.

Specified by:
startNumberList in interface NumberListHandler
Overrides:
startNumberList in class DefaultNumberListHandler
Throws:
ParseException - if an error occures while processing the number list.

numberValue

public void numberValue(float v)
                 throws ParseException
Invoked when a float value has been parsed.

Specified by:
numberValue in interface NumberListHandler
Overrides:
numberValue in class DefaultNumberListHandler
Throws:
ParseException - if an error occures while processing the number

endNumberList

public void endNumberList()
                   throws ParseException
Invoked when the number list attribute ends.

Specified by:
endNumberList in interface NumberListHandler
Overrides:
endNumberList in class DefaultNumberListHandler
Throws:
ParseException - if an error occures while processing the number list.

startPoints

public void startPoints()
                 throws ParseException
Implements PointsHandler.startPoints().

Specified by:
startPoints in interface PointsHandler
Throws:
ParseException - if an error occured while processing the points

point

public void point(float x,
                  float y)
           throws ParseException
Implements PointsHandler.point(float,float).

Specified by:
point in interface PointsHandler
Parameters:
x - the x coordinate of the point
y - the y coordinate of the point
Throws:
ParseException - if an error occured while processing the points

endPoints

public void endPoints()
               throws ParseException
Implements PointsHandler.endPoints().

Specified by:
endPoints in interface PointsHandler
Throws:
ParseException - if an error occured while processing the points


Copyright © 2008 Apache Software Foundation. All Rights Reserved.