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.ConnectionComponent<LoopbackShortSender>
, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<LoopbackShortSender>
, org.refcodes.component.ConnectionOpenable<LoopbackShortSender>
, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackShortSender>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.OpenedAccessor
, ConnectionShortReceiver<LoopbackShortSender>
, LoopbackShortReceiver
, Receivable
, ShortBlockProvider
, ShortBlockReceiver
, ShortDatagramProvider
, ShortDatagramReceiver
, ShortProvider
, ShortReceiver
, org.refcodes.mixin.Releaseable
public class LoopbackShortReceiverImpl extends AbstractShortReceiver implements LoopbackShortReceiver
LoopbackShortReceiver
interface.org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON extends Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends Object,B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON,B>>
org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON extends Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends Object,B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON,B>>
_datagramQueue, DATAGRAM_QUEUE_SIZE
Constructor | Description |
---|---|
LoopbackShortReceiverImpl() |
Instantiates a new loopback short receiver impl.
|
LoopbackShortReceiverImpl(int aCapacity) |
Instantiates a new loopback short receiver impl.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
boolean |
isOpenable(LoopbackShortSender aLoopbackSender) |
|
void |
open(LoopbackShortSender aLoopbackSender) |
|
void |
pushDatagram(short aDatagram) |
Pushes a datagram into the receiver and puts it into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(short[] aDatagrams) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
void |
pushDatagrams(short[] aDatagrams,
int aOffset,
int aLength) |
Pushes datagrams into the receiver and puts them into the blocking queue
containing the so far received datagrams.
|
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
hasDatagram, readDatagram, readDatagrams, readDatagrams, releaseAll
closeIn, closeQuietly, closeUnchecked
getConnectionStatus, isConnectionOpened
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasDatagram
readDatagram
readDatagrams, readDatagrams
public LoopbackShortReceiverImpl()
public LoopbackShortReceiverImpl(int aCapacity)
aCapacity
- the capacitypublic boolean isOpenable(LoopbackShortSender aLoopbackSender)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<LoopbackShortSender>
public void open(LoopbackShortSender aLoopbackSender) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.ConnectionOpenable<LoopbackShortSender>
org.refcodes.component.OpenException
public void pushDatagram(short aDatagram) throws org.refcodes.component.OpenException
AbstractShortReceiver.readDatagram()
: use AbstractShortReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagram
in interface LoopbackShortReceiver
pushDatagram
in class AbstractShortReceiver
aDatagram
- The datagram to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortReceiver.readDatagram()
method.org.refcodes.component.OpenException
- the open exceptionpublic void pushDatagrams(short[] aDatagrams) throws org.refcodes.component.OpenException
AbstractShortReceiver.readDatagram()
: use AbstractShortReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagrams
in interface LoopbackShortReceiver
pushDatagrams
in class AbstractShortReceiver
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortReceiver.readDatagram()
method.org.refcodes.component.OpenException
- the open exceptionpublic void pushDatagrams(short[] aDatagrams, int aOffset, int aLength) throws org.refcodes.component.OpenException
AbstractShortReceiver.readDatagram()
: use AbstractShortReceiver.hasDatagram()
to test
beforehand whether there is a datagram available.pushDatagrams
in interface LoopbackShortReceiver
pushDatagrams
in class AbstractShortReceiver
aDatagrams
- The datagrams to be pushed at the end of the blocking
queue; to be retrieved with the AbstractShortReceiver.readDatagram()
method.aOffset
- The offset to start taking data from to be pushed.aLength
- The number of elements to be pushed from the offset
onwards.org.refcodes.component.OpenException
- the open exceptionpublic void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class AbstractShortReceiver
org.refcodes.component.CloseException
Copyright © 2018. All rights reserved.