Class SequenceSection
java.lang.Object
org.refcodes.serial.SequenceSection
- All Implemented Interfaces:
Serializable, AliasAccessor, LengthAccessor, PayloadAccessor<Sequence>, PayloadAccessor.PayloadBuilder<Sequence, PayloadTransmission<Sequence>>, PayloadAccessor.PayloadMutator<Sequence>, PayloadAccessor.PayloadProperty<Sequence>, Resetable, Diagnosable, Schemable<DiagnosticOptions>, PayloadSection<Sequence>, PayloadTransmission<Sequence>, Section, Section.SectionMixin, Transmission, Transmission.TransmissionMixin
- Direct Known Subclasses:
DynamicTypeSection
public class SequenceSection
extends Object
implements PayloadSection<Sequence>, Section.SectionMixin
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface AliasAccessor
AliasAccessor.AliasBuilder<B>, AliasAccessor.AliasMutator, AliasAccessor.AliasPropertyNested classes/interfaces inherited from interface LengthAccessor
LengthAccessor.LengthBuilder<B>, LengthAccessor.LengthMutator, LengthAccessor.LengthPropertyNested classes/interfaces inherited from interface PayloadAccessor
PayloadAccessor.PayloadBuilder<P,B>, PayloadAccessor.PayloadMutator<P>, PayloadAccessor.PayloadProperty<P> Nested classes/interfaces inherited from interface Section
Section.SectionMixinNested classes/interfaces inherited from interface Transmission
Transmission.TransmissionMixin -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs theSequenceSection.SequenceSection(int aSequenceSize) Constructs theSequenceSection.SequenceSection(String aAlias) Constructs theSequenceSection.SequenceSection(String aAlias, int aSequenceSize) Constructs theSequenceSection.SequenceSection(String aAlias, Sequence aSequence) Constructs theSequenceSection.SequenceSection(Sequence aSequence) Constructs theSequenceSection. -
Method Summary
Modifier and TypeMethodDescriptionvoidfromTransmission(Sequence aSequence, int aOffset, int aLength) (Re-)initializes this instance with the the givenSequencedata.getAlias()intDetermines the overall length of thisTransmission.voidreset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!)voidsetPayload(Sequence aValue) toSchema()Provides theSequencerepresentation of thisTransmission.Returns theImmutableSimpleTypeTablerepresentation of thisTransmission.withPayload(Sequence aValue) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PayloadAccessor
getPayloadOrMethods inherited from interface PayloadAccessor.PayloadProperty
letPayloadMethods inherited from interface Section
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFromMethods inherited from interface Section.SectionMixin
receiveFromMethods inherited from interface Transmission
transmitTo, transmitToMethods inherited from interface Transmission.TransmissionMixin
transmitTo
-
Field Details
-
_sequence
-
_alias
-
-
Constructor Details
-
SequenceSection
public SequenceSection()Constructs theSequenceSection. -
SequenceSection
Constructs theSequenceSection.- Parameters:
aAlias- The alias which identifies the content of thisSection.
-
SequenceSection
public SequenceSection(int aSequenceSize) Constructs theSequenceSection.- Parameters:
aSequenceSize- The size of theSequence.
-
SequenceSection
Constructs theSequenceSection. -
SequenceSection
Constructs theSequenceSection.- Parameters:
aSequence- TheSequencerepresenting thisSequenceSection.
-
SequenceSection
Constructs theSequenceSection.- Parameters:
aAlias- The alias which identifies the content of thisSegment.aSequence- TheSequencerepresenting thisSequenceSection.
-
-
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 interfaceLengthAccessor- 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.
-
fromTransmission
public void fromTransmission(Sequence aSequence, int aOffset, int aLength) throws TransmissionException (Re-)initializes this instance with the the givenSequencedata.- Specified by:
fromTransmissionin interfaceSection- Parameters:
aSequence- TheSequencedata from which to (re-)initialize this instance.aOffset- The offset where to start processing the providedSequence.aLength- The length of data assigned by theSequence.- Throws:
TransmissionException- thrown in case a givenSequencecannot be processed.
-
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 interfaceResetable- Specified by:
resetin interfaceTransmission
-
toSchema
- Specified by:
toSchemain interfaceSchemable<DiagnosticOptions>
-
getAlias
- Specified by:
getAliasin interfaceAliasAccessor
-
withPayload
- Specified by:
withPayloadin interfacePayloadAccessor.PayloadBuilder<Sequence, PayloadTransmission<Sequence>>
-
getPayload
- Specified by:
getPayloadin interfacePayloadAccessor<Sequence>
-
setPayload
- Specified by:
setPayloadin interfacePayloadAccessor.PayloadMutator<Sequence>
-
toSimpleTypeTable
Returns theImmutableSimpleTypeTablerepresentation of thisTransmission. In case this Transmission hasTransmissionchildren, then the children are queried as well and contained in the resultingImmutableSimpleTypeTable. The aliases of the accordingTransmissioninstances represent the resulting path to aTransmission's final simple type.- Specified by:
toSimpleTypeTablein interfaceTransmission- Returns:
- The
ImmutableSimpleTypeTablerepresenting thisTransmissionand (if any) its children, with the according aliases forming the paths to theTransmission's values.
-