Package org.apache.batik.parser
Class LengthArrayProducer
- java.lang.Object
-
- org.apache.batik.parser.DefaultLengthHandler
-
- org.apache.batik.parser.DefaultLengthListHandler
-
- org.apache.batik.parser.LengthArrayProducer
-
- All Implemented Interfaces:
LengthHandler
,LengthListHandler
public class LengthArrayProducer extends DefaultLengthListHandler
A handler class that generates an array of shorts and an array floats from parsing a length list.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
count
The total number of lengths accumulated.protected short
currentUnit
The unit for the current length.protected int
index
The index in which to store the next length.protected short[]
u
The currentshort[]
object.protected java.util.LinkedList
us
List ofshort[]
objects.protected float[]
v
The currentfloat[]
object.protected java.util.LinkedList
vs
List offloat[]
objects.-
Fields inherited from class org.apache.batik.parser.DefaultLengthListHandler
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description LengthArrayProducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cm()
ImplementsLengthHandler.cm()
.void
em()
ImplementsLengthHandler.em()
.void
endLength()
ImplementsLengthHandler.endLength()
.void
endLengthList()
Invoked when the length list attribute ends.void
ex()
ImplementsLengthHandler.ex()
.short[]
getLengthTypeArray()
Returns the array of length units accumulated.float[]
getLengthValueArray()
Returns the array of length values accumulated.void
in()
ImplementsLengthHandler.in()
.void
lengthValue(float val)
ImplementsLengthHandler.lengthValue(float)
.void
mm()
ImplementsLengthHandler.mm()
.void
numberValue(float v)
Invoked when a float value has been parsed.void
pc()
ImplementsLengthHandler.pc()
.void
percentage()
ImplementsLengthHandler.percentage()
.void
pt()
ImplementsLengthHandler.pt()
.void
px()
ImplementsLengthHandler.px()
.void
startLength()
ImplementsLengthHandler.startLength()
.void
startLengthList()
Invoked when the length list attribute starts.
-
-
-
Field Detail
-
vs
protected java.util.LinkedList vs
List offloat[]
objects.
-
v
protected float[] v
The currentfloat[]
object.
-
us
protected java.util.LinkedList us
List ofshort[]
objects.
-
u
protected short[] u
The currentshort[]
object.
-
index
protected int index
The index in which to store the next length.
-
count
protected int count
The total number of lengths accumulated.
-
currentUnit
protected short currentUnit
The unit for the current length.
-
-
Method Detail
-
getLengthTypeArray
public short[] getLengthTypeArray()
Returns the array of length units accumulated.
-
getLengthValueArray
public float[] getLengthValueArray()
Returns the array of length values accumulated.
-
startLengthList
public void startLengthList() throws ParseException
Invoked when the length list attribute starts.- Specified by:
startLengthList
in interfaceLengthListHandler
- Overrides:
startLengthList
in classDefaultLengthListHandler
- 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.- Throws:
ParseException
- if an error occures while processing the number
-
lengthValue
public void lengthValue(float val) throws ParseException
ImplementsLengthHandler.lengthValue(float)
.- Specified by:
lengthValue
in interfaceLengthHandler
- Overrides:
lengthValue
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
startLength
public void startLength() throws ParseException
ImplementsLengthHandler.startLength()
.- Specified by:
startLength
in interfaceLengthHandler
- Overrides:
startLength
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
endLength
public void endLength() throws ParseException
ImplementsLengthHandler.endLength()
.- Specified by:
endLength
in interfaceLengthHandler
- Overrides:
endLength
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
em
public void em() throws ParseException
ImplementsLengthHandler.em()
.- Specified by:
em
in interfaceLengthHandler
- Overrides:
em
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
ex
public void ex() throws ParseException
ImplementsLengthHandler.ex()
.- Specified by:
ex
in interfaceLengthHandler
- Overrides:
ex
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
in
public void in() throws ParseException
ImplementsLengthHandler.in()
.- Specified by:
in
in interfaceLengthHandler
- Overrides:
in
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
cm
public void cm() throws ParseException
ImplementsLengthHandler.cm()
.- Specified by:
cm
in interfaceLengthHandler
- Overrides:
cm
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
mm
public void mm() throws ParseException
ImplementsLengthHandler.mm()
.- Specified by:
mm
in interfaceLengthHandler
- Overrides:
mm
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
pc
public void pc() throws ParseException
ImplementsLengthHandler.pc()
.- Specified by:
pc
in interfaceLengthHandler
- Overrides:
pc
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
pt
public void pt() throws ParseException
ImplementsLengthHandler.pt()
.- Specified by:
pt
in interfaceLengthHandler
- Overrides:
pt
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
px
public void px() throws ParseException
ImplementsLengthHandler.px()
.- Specified by:
px
in interfaceLengthHandler
- Overrides:
px
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
percentage
public void percentage() throws ParseException
ImplementsLengthHandler.percentage()
.- Specified by:
percentage
in interfaceLengthHandler
- Overrides:
percentage
in classDefaultLengthHandler
- Throws:
ParseException
- if an error occures while processing the length
-
endLengthList
public void endLengthList() throws ParseException
Invoked when the length list attribute ends.- Specified by:
endLengthList
in interfaceLengthListHandler
- Overrides:
endLengthList
in classDefaultLengthListHandler
- Throws:
ParseException
- if an error occures while processing the number list.
-
-