jaron.flightgear
Class FlightGearXMLParser
java.lang.Object
jaron.flightgear.FlightGearParser
jaron.flightgear.FlightGearXMLParser
public class FlightGearXMLParser
- extends FlightGearParser
The FlightGearXMLParser
is a parser for the data that is
sent from FlightGear (FG) via its generic output interface.
Although the number of parameter may vary the principal structure of the
data provided by FG has to be of the following form:
<?xml version="1.0" encoding="windows-1250"?>
<data>
<controls-flight-elevator>0.300000</controls-flight-elevator>
<controls-flight-aileron>-1.000000</controls-flight-aileron>
</data>
After the parsing, the data may be accessed via getDouble
and
getString
and the keys defined in the XML structure (e.g.
controls-flight-elevator
).
- Since:
- 1.0
- Version:
- 1.2
- Author:
- jarontec gmail com
Method Summary |
java.lang.Boolean |
parse(java.lang.String data)
Parses the data which is received via the FlightGear generic output
interface. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FlightGearXMLParser
public FlightGearXMLParser()
parse
public java.lang.Boolean parse(java.lang.String data)
- Parses the data which is received via the FlightGear generic output
interface.
After the parsing the data may be accessed via getDouble
and
getString
and the keys defined in the XML structure (e.g.
controls-flight-elevator
).
- Specified by:
parse
in class FlightGearParser
- Parameters:
data
- the data received from FlightGear
- Returns:
true
if the parsing was successful