ocss.nmea.api
Class NMEAClient
java.lang.Object
|
+--ocss.nmea.api.NMEAClient
- public abstract class NMEAClient
- extends java.lang.Object
A View. Must be extended to be used from the client.
The typical sequence would look like this:
public class CustomClient extends NMEAClient
{
public CustomClient(String s, String[] sa)
{
super(s, sa);
}
public static void main(String[] args)
{
String prefix = "II";
String[] array = {"HDM", "GLL", "XTE", "MWV", "VHW"};
CustomClient customClient = new CustomClient(prefix, array); // Extends NMEAReader
customClient.initClient();
customClient.setReader(new CustomReader(customClient.getListeners()));
customClient.startWorking();
}
}
Constructor Summary |
NMEAClient()
|
NMEAClient(java.lang.String prefix,
java.lang.String[] sentence)
Create the client |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NMEAClient
public NMEAClient()
NMEAClient
public NMEAClient(java.lang.String prefix,
java.lang.String[] sentence)
- Create the client
- Parameters:
prefix
- the Device Identifiersentence
- the String Array containing the NMEA sentence identifiers to read
initClient
public void initClient()
setDevicePrefix
public void setDevicePrefix(java.lang.String s)
getDevicePrefix
public java.lang.String getDevicePrefix()
setSentenceArray
public void setSentenceArray(java.lang.String[] sa)
getSentenceArray
public java.lang.String[] getSentenceArray()
setParser
public void setParser(NMEAParser p)
getParser
public NMEAParser getParser()
setReader
public void setReader(NMEAReader r)
getReader
public NMEAReader getReader()
getListeners
public java.util.ArrayList getListeners()
startWorking
public void startWorking()
dataDetectedEvent
public abstract void dataDetectedEvent(NMEAEvent e)
- This one must be overwritten to customize the behavior of the client,
like the destination of the data.
addNMEAListener
public void addNMEAListener(NMEAListener l)
removeNMEAListener
public void removeNMEAListener(NMEAListener l)