Package org.apache.batik.parser
Class FloatArrayProducer
- java.lang.Object
-
- org.apache.batik.parser.DefaultNumberListHandler
-
- 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.- Version:
- $Id: FloatArrayProducer.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]
a
The currentfloat[]
object.protected java.util.LinkedList
as
List offloat[]
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
Constructors Constructor Description FloatArrayProducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endNumberList()
Invoked when the number list attribute ends.void
endPoints()
ImplementsPointsHandler.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)
ImplementsPointsHandler.point(float,float)
.void
startNumberList()
Invoked when the number list attribute starts.void
startPoints()
ImplementsPointsHandler.startPoints()
.-
Methods inherited from class org.apache.batik.parser.DefaultNumberListHandler
endNumber, startNumber
-
-
-
-
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 interfaceNumberListHandler
- Overrides:
startNumberList
in classDefaultNumberListHandler
- 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 interfaceNumberListHandler
- Overrides:
numberValue
in classDefaultNumberListHandler
- 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 interfaceNumberListHandler
- Overrides:
endNumberList
in classDefaultNumberListHandler
- Throws:
ParseException
- if an error occures while processing the number list.
-
startPoints
public void startPoints() throws ParseException
ImplementsPointsHandler.startPoints()
.- Specified by:
startPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-
point
public void point(float x, float y) throws ParseException
ImplementsPointsHandler.point(float,float)
.- Specified by:
point
in interfacePointsHandler
- Parameters:
x
- the x coordinate of the pointy
- the y coordinate of the point- Throws:
ParseException
- if an error occured while processing the points
-
endPoints
public void endPoints() throws ParseException
ImplementsPointsHandler.endPoints()
.- Specified by:
endPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-
-