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
 
Method Summary
 void addNMEAListener(NMEAListener l)
           
abstract  void dataDetectedEvent(NMEAEvent e)
          This one must be overwritten to customize the behavior of the client, like the destination of the data.
 java.lang.String getDevicePrefix()
           
 java.util.ArrayList getListeners()
           
 NMEAParser getParser()
           
 NMEAReader getReader()
           
 java.lang.String[] getSentenceArray()
           
 void initClient()
           
 void removeNMEAListener(NMEAListener l)
           
 void setDevicePrefix(java.lang.String s)
           
 void setParser(NMEAParser p)
           
 void setReader(NMEAReader r)
           
 void setSentenceArray(java.lang.String[] sa)
           
 void startWorking()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NMEAClient

public NMEAClient()

NMEAClient

public NMEAClient(java.lang.String prefix,
                  java.lang.String[] sentence)
Create the client

Parameters:
prefix - the Device Identifier
sentence - the String Array containing the NMEA sentence identifiers to read
Method Detail

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)