net.sf.marineapi.provider
Class PositionProvider

java.lang.Object
  extended by net.sf.marineapi.provider.AbstractProvider<PositionEvent>
      extended by net.sf.marineapi.provider.PositionProvider
All Implemented Interfaces:
EventListener, SentenceListener

public class PositionProvider
extends AbstractProvider<PositionEvent>

Provides Time, Position and Velocity reports from GPS. Data is captured from RMC, GGA and GLL sentences. RMC is used for date/time, speed and course. GGA is used as primary source for position as it contains also the altitude. When GGA is not available, position may be taken from GLL or RMC. If this is the case, there is no altitude included in the Position. GPS data statuses are also captured and events are dispatched only when sentences report DataStatus.ACTIVE.

Author:
Kimmo Tuukkanen
See Also:
PositionListener, PositionEvent, SentenceReader

Constructor Summary
PositionProvider(SentenceReader reader)
          Creates a new instance of PositionProvider.
 
Method Summary
protected  PositionEvent createProviderEvent()
          Creates a ProviderEvent of type T.
protected  boolean isReady()
          Tells if provider has captured the required sentences for creating new ProviderEvent.
protected  boolean isValid()
          Tells if the captured sentence events contain valid data to be dispatched to ProviderListeners.
 
Methods inherited from class net.sf.marineapi.provider.AbstractProvider
addListener, getSentences, hasAll, hasOne, readingPaused, readingStarted, readingStopped, removeListener, sentenceRead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionProvider

public PositionProvider(SentenceReader reader)
Creates a new instance of PositionProvider.

Parameters:
reader - SentenceReader that provides the required sentences.
Method Detail

createProviderEvent

protected PositionEvent createProviderEvent()
Description copied from class: AbstractProvider
Creates a ProviderEvent of type T.

Specified by:
createProviderEvent in class AbstractProvider<PositionEvent>
Returns:
Created event, or null if failed.

isReady

protected boolean isReady()
Description copied from class: AbstractProvider
Tells if provider has captured the required sentences for creating new ProviderEvent.

Specified by:
isReady in class AbstractProvider<PositionEvent>
Returns:
true if ready to create ProviderEvent, otherwise false.

isValid

protected boolean isValid()
Description copied from class: AbstractProvider
Tells if the captured sentence events contain valid data to be dispatched to ProviderListeners.

Specified by:
isValid in class AbstractProvider<PositionEvent>
Returns:
true if valid, otherwise false.


Copyright (C) 2010-2014 Java Marine API authors. All Rights Reserved.