jaron.flightgear
Class FlightGearParser

java.lang.Object
  extended by jaron.flightgear.FlightGearParser
Direct Known Subclasses:
FlightGearXMLParser

public abstract class FlightGearParser
extends java.lang.Object

The FlightGearParser is an abstract class that must be implemented by a subclass.

Since:
1.0
Version:
1.2
Author:
jarontec gmail com

Constructor Summary
FlightGearParser()
           
 
Method Summary
 double getDouble(java.lang.String key)
          Returns a double value that is parsed from the FlightGear output.
 java.lang.String getString(java.lang.String key)
          Returns a String value that is parsed from the FlightGear output.
 java.lang.Boolean hasData()
          Returns true if the parser has some data available.
abstract  java.lang.Boolean parse(java.lang.String data)
          Parses the data which is received via the FlightGear generic i/o interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlightGearParser

public FlightGearParser()
Method Detail

parse

public abstract java.lang.Boolean parse(java.lang.String data)
Parses the data which is received via the FlightGear generic i/o interface.

Parameters:
data - the data received from FlightGear
Returns:
true if the parsing was successful

getDouble

public double getDouble(java.lang.String key)
Returns a double value that is parsed from the FlightGear output. If the value could not be found or converted then 0 is returned.

Parameters:
key - a reference to the FlightGear data
Returns:
the double value referenced by the key

getString

public java.lang.String getString(java.lang.String key)
Returns a String value that is parsed from the FlightGear output. If the value could not be found an empty string is returned.

Parameters:
key - a reference to the FlightGear data
Returns:
the double value referenced by the key

hasData

public java.lang.Boolean hasData()
Returns true if the parser has some data available. This is used to determine if the FlightGear data has been correctly received.

Returns:
a boolean value indicating if data is available