Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractTransmissionDecorator<DECORATEE extends Transmission>
java.lang.Object
org.refcodes.serial.AbstractTransmissionDecorator<DECORATEE>
- Type Parameters:
DECORATEE- TheTransmissiontype describing theTransmissionsubclass to be enriched.
- All Implemented Interfaces:
Serializable,org.refcodes.mixin.DecorateeAccessor<DECORATEE>,org.refcodes.mixin.LengthAccessor,org.refcodes.mixin.Resetable,org.refcodes.schema.Schemable,Transmission,Transmission.TransmissionMixin
- Direct Known Subclasses:
AbstractCipherTransmissionDecorator,AbstractInvertibleTransmissionDecorator,AbstractSectionDecorator,AbstractSegmentDecorator,AllocSegmentBody,BreakerSectionDecorator,BreakerSegmentDecorator
public abstract class AbstractTransmissionDecorator<DECORATEE extends Transmission>
extends Object
implements Transmission, Transmission.TransmissionMixin, org.refcodes.mixin.DecorateeAccessor<DECORATEE>
An abstract implementation of a
Transmission decorating another
Transmission.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.DecorateeAccessor
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> Nested classes/interfaces inherited from interface org.refcodes.mixin.LengthAccessor
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an emptyDecoratorSegment.AbstractTransmissionDecorator(DECORATEE aDecoratee) Constructs aDecoratorSegmentinstance with the given decoratee. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintDetermines the overall length of thisTransmission.inthashCode()voidreset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!)Provides theSequencerepresentation of thisTransmission.org.refcodes.struct.SimpleTypeMapReturns theSimpleTypeMaprepresentation of thisTransmission.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.serial.Transmission
toSchema, transmitTo, transmitToMethods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitTo
-
Field Details
-
_decoratee
-
-
Constructor Details
-
AbstractTransmissionDecorator
protected AbstractTransmissionDecorator()Constructs an emptyDecoratorSegment. -
AbstractTransmissionDecorator
Constructs aDecoratorSegmentinstance with the given decoratee.- Parameters:
aDecoratee- The decoratee to be contained by this facade.
-
-
Method Details
-
getLength
public int getLength()Determines the overall length of thisTransmission. In case of nestedTransmissioninstances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLengthin interfaceorg.refcodes.mixin.LengthAccessor- Specified by:
getLengthin interfaceTransmission- Returns:
- The (overall) length of the
Transmission(including any sub-segments).
-
toSequence
Provides theSequencerepresentation of thisTransmission. In case of nestedTransmissioninstances, allSequencerepresentations from all sub-segments are accumulated to the result as well. Caution, the Transmission (or its nestedTransmissioninstances) may be backed by the returnedSequence.- Specified by:
toSequencein interfaceTransmission- Returns:
- The according instance's
Sequence.
-
getDecoratee
- Specified by:
getDecorateein interfaceorg.refcodes.mixin.DecorateeAccessor<DECORATEE extends Transmission>
-
reset
public void reset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!) reset any configurations or settings required to produce the dynamic data (e.g. theTransmissionMetrics).- Specified by:
resetin interfaceorg.refcodes.mixin.Resetable- Specified by:
resetin interfaceTransmission
-
toString
-
hashCode
public int hashCode() -
equals
-
toSimpleTypeMap
public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()Returns theSimpleTypeMaprepresentation of thisTransmission. In case this Transmission hasTransmissionchildren, then the children are queried as well and contained in the resultingSimpleTypeMap. The aliases of the accordingTransmissioninstances represent the resulting path to aTransmission's final simple type.- Specified by:
toSimpleTypeMapin interfaceTransmission- Returns:
- The
SimpleTypeMaprepresenting thisTransmissionand (if any) its children, with the according aliases forming the paths to theTransmission's values.
-