类 AbstractAISMessageListener<T extends AISMessage>
- 类型参数:
T- AIS message type to be listened.
- 所有已实现的接口:
EventListener,SentenceListener
- 直接已知子类:
AISListenerExample
Abstract listener for AIS messages. Extend this class to create a listener
for a specific AIS message type and register it in a
SentenceReader.
To listen to all incoming AIS sentences, extend the AbstractSentenceListener using AISSentence as type. However, in this
case you also need to implement the message concatenation to parse messages
being delivered over multiple sentences.
This class is based on AbstractSentenceListener and thus it has the
same recommendations and limitations regarding the usage of generics and
inheritance.
- 作者:
- Kimmo Tuukkanen
- 另请参阅:
-
构造器概要
构造器构造器说明Default constructor with automatic generic type resolving.Constructor with explicit generic type parameter. -
方法概要
修饰符和类型方法说明abstract voidInvoked when AIS message has been received.voidEmpty implementation.voidEmpty implementation.voidEmpty implementation.final voidsentenceRead(AISSentence sentence) Invoked whenAISSentenceof any type is received.从类继承的方法 net.sf.marineapi.nmea.event.AbstractSentenceListener
sentenceRead
-
构造器详细资料
-
AbstractAISMessageListener
public AbstractAISMessageListener()Default constructor with automatic generic type resolving. Notice that theGenericTypeResolvermay not always succeed.- 抛出:
IllegalStateException- If the generic type cannot be resolved at runtime.- 另请参阅:
-
AbstractAISMessageListener
Constructor with explicit generic type parameter. This constructor may be used when the default constructor fails to resolve the generic typeTat runtime.- 参数:
c- Message typeTto be listened.- 另请参阅:
-
-
方法详细资料
-
sentenceRead
Invoked when
AISSentenceof any type is received. Pre-parses the message to determine it's type and invokes theonMessage(net.sf.marineapi.ais.message.AISMessage)method when the type matches the generic typeT.This method has been declared
finalto ensure the correct handling of received sentences.- 指定者:
sentenceRead在类中AbstractSentenceListener<AISSentence>- 参数:
sentence- Sentence of typeT
-
onMessage
Invoked when AIS message has been received.- 参数:
msg- AISMessage of typeT
-
readingPaused
public void readingPaused()Empty implementation.- 指定者:
readingPaused在接口中SentenceListener- 覆盖:
readingPaused在类中AbstractSentenceListener<AISSentence>- 另请参阅:
-
readingStarted
public void readingStarted()Empty implementation.- 指定者:
readingStarted在接口中SentenceListener- 覆盖:
readingStarted在类中AbstractSentenceListener<AISSentence>- 另请参阅:
-
readingStopped
public void readingStopped()Empty implementation.- 指定者:
readingStopped在接口中SentenceListener- 覆盖:
readingStopped在类中AbstractSentenceListener<AISSentence>- 另请参阅:
-