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
A handler class that generates an array of floats from parsing a
number list or a point list.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float[]
The currentfloat[]
object.protected LinkedList
List offloat[]
objects.protected int
The total number of floats accumulated.protected int
The index in which to store the next number.Fields inherited from class org.apache.batik.parser.DefaultNumberListHandler
INSTANCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when the number list attribute ends.void
ImplementsPointsHandler.endPoints()
.float[]
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
Invoked when the number list attribute starts.void
ImplementsPointsHandler.startPoints()
.Methods inherited from class org.apache.batik.parser.DefaultNumberListHandler
endNumber, startNumber
-
Field Details
-
as
List offloat[]
objects. -
a
protected float[] aThe currentfloat[]
object. -
index
protected int indexThe index in which to store the next number. -
count
protected int countThe total number of floats accumulated.
-
-
Constructor Details
-
FloatArrayProducer
public FloatArrayProducer()
-
-
Method Details
-
getFloatArray
public float[] getFloatArray()Returns the array of floats accumulated. -
startNumberList
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
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
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
ImplementsPointsHandler.startPoints()
.- Specified by:
startPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-
point
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
ImplementsPointsHandler.endPoints()
.- Specified by:
endPoints
in interfacePointsHandler
- Throws:
ParseException
- if an error occured while processing the points
-