DECORATEE
- The Transmission
type describing the
Transmission
subclass to be enriched.sSerializable
, org.refcodes.mixin.LengthAccessor
, Transmission
, Transmission.TransmissionMixin
InvertibleSectionDecorator
, InvertibleSegmentDecorator
public abstract class AbstractInvertibleTransmissionDecorator<DECORATEE extends Transmission> extends AbstractTransmissionDecorator<DECORATEE>
org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE extends Object,B extends org.refcodes.mixin.DecorateeAccessor.DecorateeBuilder<DECORATEE,B>>, org.refcodes.mixin.DecorateeAccessor.DecorateeMutator<DECORATEE extends Object>, org.refcodes.mixin.DecorateeAccessor.DecorateeProperty<DECORATEE extends Object>
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
Transmission.TransmissionMixin
Modifier and Type | Field | Description |
---|---|---|
protected org.refcodes.numerical.BijectiveFunction<Byte,Byte> |
_bijectiveFunction |
|
protected org.refcodes.numerical.InverseFunction<Byte,Byte> |
_inverseFunction |
_decoratee
Constructor | Description |
---|---|
AbstractInvertibleTransmissionDecorator(DECORATEE aDecoratee,
org.refcodes.numerical.BijectiveFunction<Byte,Byte> aBijectiveFunction,
org.refcodes.numerical.InverseFunction<Byte,Byte> aInverseFunction) |
Constructs an invertible transmission decorator applying bijective and
inverse functions upon the delegated methods.
|
AbstractInvertibleTransmissionDecorator(DECORATEE aDecoratee,
org.refcodes.numerical.Invertible<Byte,Byte> aInvertible) |
Constructs an invertible transmission decorator applying bijective and
inverse functions upon the delegated methods.
|
Modifier and Type | Method | Description |
---|---|---|
Schema |
toSchema() |
Retrieves the
Schema representing the Transmission . |
Sequence |
toTransmission() |
Provides the
Sequence representation of this
Transmission . |
void |
transmitTo(OutputStream aOutputStream,
InputStream aReturnStream) |
Transmits the
Sequence representing the implementing type's
instance to the given OutputStream . |
equals, getDecoratee, getLength, hashCode, toSimpleTypeMap, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fromInputStream, transmitTo, transmitTo
public AbstractInvertibleTransmissionDecorator(DECORATEE aDecoratee, org.refcodes.numerical.Invertible<Byte,Byte> aInvertible)
aDecoratee
- The decorator having applied the Invertible
's
BijectiveFunction
to encode and the Invertible
's
InverseFunction
to decode any data being delegated.aInvertible
- The Invertible
providing the
BijectiveFunction
to encode and the Invertible
's
InverseFunction
to decode any data being delegated.public AbstractInvertibleTransmissionDecorator(DECORATEE aDecoratee, org.refcodes.numerical.BijectiveFunction<Byte,Byte> aBijectiveFunction, org.refcodes.numerical.InverseFunction<Byte,Byte> aInverseFunction)
aDecoratee
- The decorator having applied the
BijectiveFunction
to encode and the
InverseFunction
to decode any data being delegated.aBijectiveFunction
- The BijectiveFunction
to encode any
data being delegated.aInverseFunction
- The InverseFunction
to decode any data
being delegated.public void transmitTo(OutputStream aOutputStream, InputStream aReturnStream) throws IOException
Sequence
representing the implementing type's
instance to the given OutputStream
. Implementations providing
error correction methods use the provided feedback InputStream
to
do some sort of "stop-and-wait ARQ" or apply similar methods to ensure
correctness of the transmitted data.aOutputStream
- The OutputStream
where to write this
instance's Sequence
to.aReturnStream
- An InputStream
being the return channel to
handle "stop-and-wait ARQ" or the like in case of a bidirectional
connection. Can be null in case we have a unidirectional
connection.IOException
- thrown in case writing data to the
OutputStream
caused problems.public Sequence toTransmission()
Sequence
representation of this
Transmission
. In case of nested Transmission
instances,
all Sequence
representations from all sub-segments are
accumulated to the result as well.toTransmission
in interface Transmission
toTransmission
in class AbstractTransmissionDecorator<DECORATEE extends Transmission>
Sequence
.public Schema toSchema()
Schema
representing the Transmission
.
Retrieving a Schema
is useful when analyzing and debugging data
structures such as a AllocSectionDecoratorSegment
instance to help
document, learn and verify on the structure (as well as the content) of
that very AllocSectionDecoratorSegment
.Schema
representation of the implementing type for
debugging and verification (or documentation) purposes.Copyright © 2021. All rights reserved.