- java.lang.Object
-
- org.refcodes.io.AbstractBytesDestination
-
- org.refcodes.io.AbstractBytesReceiver
-
- org.refcodes.codec.ModemDecoderImpl
-
- All Implemented Interfaces:
Decoder
,DemodulatorStatusAccessor
,ModemDecoder
,org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseAutomaton
,org.refcodes.component.ClosedAccessor
,org.refcodes.component.ConnectableComponent
,org.refcodes.component.ConnectableComponent.ConnectableAutomaton
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.OpenedAccessor
,org.refcodes.io.Availability
,org.refcodes.io.ByteDestination
,org.refcodes.io.ByteReceiver
,org.refcodes.io.BytesDestination
,org.refcodes.io.BytesReceiver
,org.refcodes.io.Receivable
,org.refcodes.io.Skippable
,org.refcodes.io.TimeoutInputStreamAccessor
,org.refcodes.mixin.InputStreamAccessor
,org.refcodes.mixin.Loggable
- Direct Known Subclasses:
ModemDecoderImpl.ModemByteDecoderProviderImpl
,ModemDecoderImpl.ModemShortDecoderProviderImpl
public class ModemDecoderImpl extends org.refcodes.io.AbstractBytesReceiver implements ModemDecoder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModemDecoderImpl.ModemByteDecoderProviderImpl
Vanilla plain implementation of theModemDecoder.ModemByteDecoderProvider
interface to be used withBytesDestination
(BytesReceiver
) instances.static class
ModemDecoderImpl.ModemShortDecoderProviderImpl
Vanilla plain implementation of theModemDecoder.ModemByteDecoderProvider
interface to be used withBytesDestination
(BytesReceiver
) instances.-
Nested classes/interfaces inherited from class org.refcodes.io.AbstractBytesReceiver
org.refcodes.io.AbstractBytesReceiver.ConnectableAutomaton
-
Nested classes/interfaces inherited from interface org.refcodes.io.BytesReceiver
org.refcodes.io.BytesReceiver.ReceiverInputStream
-
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
-
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
-
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
-
Nested classes/interfaces inherited from interface org.refcodes.codec.DemodulatorStatusAccessor
DemodulatorStatusAccessor.DemodulatorStatusBuilder<B extends DemodulatorStatusAccessor.DemodulatorStatusBuilder<B>>, DemodulatorStatusAccessor.DemodulatorStatusMutator, DemodulatorStatusAccessor.DemodulatorStatusProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.InputStreamAccessor
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
-
Nested classes/interfaces inherited from interface org.refcodes.codec.ModemDecoder
ModemDecoder.ModemByteDecoderProvider, ModemDecoder.ModemShortDecoderProvider
-
Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
-
Nested classes/interfaces inherited from interface org.refcodes.io.TimeoutInputStreamAccessor
org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamMutator, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected org.refcodes.io.BytesReceiver
_byteReceiver
protected LinkedBlockingQueue<Byte>
_datagramQueue
protected ModemMetrics
_modemMetrics
protected org.refcodes.io.ShortsReceiver
_shortReceiver
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModemDecoderImpl(ModemMetrics aModemMetrics)
ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesDestination aByteProvider)
Instantiates a new modem decoder impl.ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesReceiver aByteReceiver)
Instantiates a new modem decoder impl.ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsDestination aShortProvider)
Instantiates a new modem decoder impl.ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsReceiver aShortReceiver)
Instantiates a new modem decoder impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
DemodulatorStatus
getDemodulatorStatus()
Retrieves the Demodulator-Status from the Demodulator-Status property.byte[]
receiveAllBytes()
byte
receiveByte()
byte[]
receiveBytes(int aMaxLength)
-
Methods inherited from class org.refcodes.io.AbstractBytesReceiver
close, getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
-
Methods inherited from class org.refcodes.io.AbstractBytesDestination
pushDatagram, pushDatagrams, pushDatagrams
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.io.BytesReceiver
getInputStream, getInputStream, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
-
Methods inherited from interface org.refcodes.component.Closable
close, closeIn, closeQuietly, closeUnchecked
-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isOpened
-
-
-
-
Field Detail
-
_modemMetrics
protected ModemMetrics _modemMetrics
-
_datagramQueue
protected LinkedBlockingQueue<Byte> _datagramQueue
-
_byteReceiver
protected org.refcodes.io.BytesReceiver _byteReceiver
-
_shortReceiver
protected org.refcodes.io.ShortsReceiver _shortReceiver
-
-
Constructor Detail
-
ModemDecoderImpl
public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesDestination aByteProvider)
Instantiates a new modem decoder impl.- Parameters:
aModemMetrics
- the modem metricsaByteProvider
- the byte provider
-
ModemDecoderImpl
public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsDestination aShortProvider)
Instantiates a new modem decoder impl.- Parameters:
aModemMetrics
- the modem metricsaShortProvider
- the short provider
-
ModemDecoderImpl
public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.ShortsReceiver aShortReceiver)
Instantiates a new modem decoder impl.- Parameters:
aModemMetrics
- the modem metricsaShortReceiver
- the short receiver
-
ModemDecoderImpl
public ModemDecoderImpl(ModemMetrics aModemMetrics, org.refcodes.io.BytesReceiver aByteReceiver)
Instantiates a new modem decoder impl.- Parameters:
aModemMetrics
- the modem metricsaByteReceiver
- the byte receiver
-
ModemDecoderImpl
protected ModemDecoderImpl(ModemMetrics aModemMetrics)
-
-
Method Detail
-
receiveAllBytes
public byte[] receiveAllBytes()
- Specified by:
receiveAllBytes
in interfaceorg.refcodes.io.BytesDestination
- Specified by:
receiveAllBytes
in interfaceorg.refcodes.io.BytesReceiver
- Overrides:
receiveAllBytes
in classorg.refcodes.io.AbstractBytesReceiver
-
available
public int available()
- Specified by:
available
in interfaceorg.refcodes.io.Availability
- Specified by:
available
in interfaceorg.refcodes.io.Skippable
- Overrides:
available
in classorg.refcodes.io.AbstractBytesReceiver
-
receiveBytes
public byte[] receiveBytes(int aMaxLength)
- Specified by:
receiveBytes
in interfaceorg.refcodes.io.BytesDestination
- Specified by:
receiveBytes
in interfaceorg.refcodes.io.BytesReceiver
- Overrides:
receiveBytes
in classorg.refcodes.io.AbstractBytesReceiver
-
receiveByte
public byte receiveByte() throws IOException
- Specified by:
receiveByte
in interfaceorg.refcodes.io.ByteDestination
- Specified by:
receiveByte
in interfaceorg.refcodes.io.BytesDestination
- Overrides:
receiveByte
in classorg.refcodes.io.AbstractBytesReceiver
- Throws:
IOException
-
getDemodulatorStatus
public DemodulatorStatus getDemodulatorStatus()
Retrieves the Demodulator-Status from the Demodulator-Status property.- Specified by:
getDemodulatorStatus
in interfaceDemodulatorStatusAccessor
- Returns:
- The Demodulator-Status stored by the Demodulator-Status property.
-
-