jaron.flightgear
Class FlightGearXMLParser

java.lang.Object
  extended by jaron.flightgear.FlightGearParser
      extended by 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

Constructor Summary
FlightGearXMLParser()
           
 
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 jaron.flightgear.FlightGearParser
getDouble, getString, hasData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlightGearXMLParser

public FlightGearXMLParser()
Method Detail

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