net.sf.marineapi.provider
Class HeadingProvider

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

public class HeadingProvider
extends AbstractProvider<HeadingEvent>

Heading provider reports the vessel's current heading. Data is captured from HDT, HDM or HDG sentences.

Author:
Kimmo Tuukkanen
See Also:
HeadingEvent, HeadingListener

Constructor Summary
HeadingProvider(SentenceReader reader)
          Creates a new intance of HeadingProvider.
 
Method Summary
protected  HeadingEvent 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

HeadingProvider

public HeadingProvider(SentenceReader reader)
Creates a new intance of HeadingProvider.

Parameters:
reader - Reader for capturing heading sentences.
Method Detail

createProviderEvent

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

Specified by:
createProviderEvent in class AbstractProvider<HeadingEvent>
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<HeadingEvent>
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<HeadingEvent>
Returns:
true if valid, otherwise false.


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