|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.marineapi.nmea.io.SentenceReader
public class SentenceReader
Sentence provider reads NMEA sentences from the specified InputStream and dispatches them to listeners as SentenceEvents.
The sentence parsers dispatched by reader are created using the
SentenceFactory where you can also register your own custom parsers.
SentenceListener,
SentenceEvent| Constructor Summary | |
|---|---|
SentenceReader(InputStream source)
Creates a new instance of SentenceReader. |
|
| Method Summary | |
|---|---|
void |
addSentenceListener(SentenceListener listener)
Adds a SentenceListener that wants to receive all sentences read
by the reader. |
void |
addSentenceListener(SentenceListener sl,
SentenceId type)
Adds a SentenceListener that is interested in receiving only
sentences of certain type. |
void |
addSentenceListener(SentenceListener sl,
String type)
Adds a SentenceListener that is interested in receiving only
sentences of certain type. |
protected void |
finalize()
|
int |
getPauseTimeout()
Returns the current reading paused timeout. |
void |
removeSentenceListener(SentenceListener sl)
Remove a listener from reader. |
void |
setInputStream(InputStream stream)
Sets the input stream from which to read NMEA data. |
void |
setPauseTimeout(int millis)
Set timeout time for reading paused events. |
void |
start()
Starts reading the input stream and dispatching events. |
void |
stop()
Stops the reader and event dispatching. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SentenceReader(InputStream source)
source - Stream from which to read NMEA data| Method Detail |
|---|
public void addSentenceListener(SentenceListener listener)
SentenceListener that wants to receive all sentences read
by the reader.
listener - SentenceListener to be registered.SentenceListener
public void addSentenceListener(SentenceListener sl,
SentenceId type)
SentenceListener that is interested in receiving only
sentences of certain type.
sl - SentenceListener to addtype - Sentence type for which the listener is registered.SentenceListener
public void addSentenceListener(SentenceListener sl,
String type)
SentenceListener that is interested in receiving only
sentences of certain type.
sl - SentenceListener to addtype - Sentence type for which the listener is registered.SentenceListenerpublic int getPauseTimeout()
setPauseTimeout(int)public void removeSentenceListener(SentenceListener sl)
sl - SentenceListener to be removed.public void setInputStream(InputStream stream)
start() to resume reading.
stream - New input stream to set.public void setPauseTimeout(int millis)
millis - Timeout in milliseconds.public void start()
public void stop()
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||