public class ShortSenderDecorator extends AbstractShortSender implements ShortSender
ShortSenderDecorator
decorates a ShortConsumer
with the
additional methods of a ShortSender
making it easy to use a
ShortConsumer
wherever a ShortSender
is expected.org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
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
Constructor and Description |
---|
ShortSenderDecorator(ShortConsumer aShortConsumer)
Instantiates a new short sender decorator.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
writeDatagram(short aDatagram)
Writes (sends) a short.
|
void |
writeDatagrams(short[] aDatagrams)
Writes (sends) a short block.
|
void |
writeDatagrams(short[] aDatagrams,
int aOffset,
int aLength)
Writes (sends) a short block.
|
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened, open, setConnectionStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeIn, closeQuietly, closeUnchecked
public ShortSenderDecorator(ShortConsumer aShortConsumer)
aShortConsumer
- the a short consumerpublic void writeDatagram(short aDatagram) throws org.refcodes.component.OpenException
ShortDatagramConsumer
writeDatagram
in interface ShortConsumer
writeDatagram
in interface ShortDatagramConsumer
aDatagram
- The short to be pushed.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void writeDatagrams(short[] aDatagrams) throws org.refcodes.component.OpenException
ShortBlockConsumer
writeDatagrams
in interface ShortBlockConsumer
writeDatagrams
in interface ShortConsumer
aDatagrams
- The short to be pushed.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void writeDatagrams(short[] aDatagrams, int aOffset, int aLength) throws org.refcodes.component.OpenException
ShortBlockConsumer
writeDatagrams
in interface ShortBlockConsumer
writeDatagrams
in interface ShortSender
aDatagrams
- The short to be pushed.aOffset
- The offset from which to take the data.aLength
- The number of elements to push starting at the given
offset.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void flush() throws org.refcodes.component.OpenException
flush
in interface Flushable
flush
in interface ShortSender
org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
close
in class org.refcodes.component.AbstractConnectableAutomaton
org.refcodes.component.CloseException
Copyright © 2017. All rights reserved.