Class SequenceSection

java.lang.Object
org.refcodes.serial.SequenceSection
All Implemented Interfaces:
Serializable, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.PayloadAccessor<Sequence>, org.refcodes.mixin.PayloadAccessor.PayloadBuilder<Sequence,PayloadTransmission<Sequence>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<Sequence>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<Sequence>, org.refcodes.mixin.Schemable<SerialSchema>, PayloadSection<Sequence>, PayloadTransmission<Sequence>, Section, Section.SectionMixin, Transmission, Transmission.TransmissionMixin
Direct Known Subclasses:
DynamicTypeSection

public class SequenceSection extends Object implements PayloadSection<Sequence>, Section.SectionMixin
The SequenceSection is a Section representing a Sequence.
See Also:
  • Field Details

    • _sequence

      protected Sequence _sequence
    • _alias

      protected String _alias
  • Constructor Details

  • Method Details

    • getLength

      public int getLength()
      Determines the overall length of this Transmission. In case of nested Transmission instances, all length values from all sub-segments are accumulated to the result as well.
      Specified by:
      getLength in interface org.refcodes.mixin.LengthAccessor
      Specified by:
      getLength in interface Transmission
      Returns:
      The (overall) length of the Transmission (including any sub-segments).
    • toSequence

      public Sequence toSequence()
      Provides the 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. Caution, the Transmission (or its nested Transmission instances) may be backed by the returned Sequence.
      Specified by:
      toSequence in interface Transmission
      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 given Sequence data.
      Specified by:
      fromTransmission in interface Section
      Parameters:
      aSequence - The Sequence data from which to (re-)initialize this instance.
      aOffset - The offset where to start processing the provided Sequence.
      aLength - The length of data assigned by the Sequence.
      Throws:
      TransmissionException - thrown in case a given Sequence cannot be processed.
    • toSchema

      public SerialSchema toSchema()
      Retrieves the SerialSchema representing the Transmission. Retrieving a SerialSchema 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.
      Specified by:
      toSchema in interface org.refcodes.mixin.Schemable<SerialSchema>
      Specified by:
      toSchema in interface Transmission
      Returns:
      The SerialSchema representation of the implementing type for debugging and verification (or documentation) purposes.
    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface org.refcodes.mixin.AliasAccessor
    • withPayload

      public PayloadTransmission<Sequence> withPayload(Sequence aValue)
      Specified by:
      withPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder<Sequence,PayloadTransmission<Sequence>>
    • getPayload

      public Sequence getPayload()
      Specified by:
      getPayload in interface org.refcodes.mixin.PayloadAccessor<Sequence>
    • setPayload

      public void setPayload(Sequence aValue)
      Specified by:
      setPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadMutator<Sequence>
    • toSimpleTypeMap

      public org.refcodes.struct.SimpleTypeMap toSimpleTypeMap()
      Returns the SimpleTypeMap representation of this Transmission. In case this Transmission has Transmission children, then the children are queried as well and contained in the resulting SimpleTypeMap. The aliases of the according Transmission instances represent the resulting path to a Transmission's final simple type.
      Specified by:
      toSimpleTypeMap in interface Transmission
      Returns:
      The SimpleTypeMap representing this Transmission and (if any) its children, with the according aliases forming the paths to the Transmission's values.