Class IntArraySection

java.lang.Object
org.refcodes.serial.AbstractPayloadSection<int[]>
org.refcodes.serial.IntArraySection
All Implemented Interfaces:
Serializable, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.PayloadAccessor<int[]>, org.refcodes.mixin.PayloadAccessor.PayloadBuilder<int[],PayloadTransmission<int[]>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<int[]>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<int[]>, org.refcodes.mixin.Resetable, org.refcodes.mixin.Schemable, PayloadSection<int[]>, PayloadTransmission<int[]>, Section, Section.SectionMixin, Transmission, Transmission.TransmissionMixin

public class IntArraySection extends AbstractPayloadSection<int[]>
The IntArraySection is an implementation of a Section carrying an integer array as payload.
See Also:
  • Field Details

  • Constructor Details

    • IntArraySection

      public IntArraySection(TransmissionMetrics aTransmissionMetrics)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • IntArraySection

      public IntArraySection(TransmissionMetrics aTransmissionMetrics, int... aValue)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      aValue - The payload to be contained by the IntArraySection.
    • IntArraySection

      public IntArraySection(TransmissionMetrics aTransmissionMetrics, Integer... aValue)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      aValue - The payload to be contained by the IntArraySection.
    • IntArraySection

      public IntArraySection(String aAlias, TransmissionMetrics aTransmissionMetrics)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aAlias - The alias which identifies the content of this instance.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
    • IntArraySection

      public IntArraySection(String aAlias, TransmissionMetrics aTransmissionMetrics, int... aValue)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aAlias - The alias which identifies the content of this instance.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      aValue - The payload to be contained by the IntArraySection.
    • IntArraySection

      public IntArraySection(String aAlias, TransmissionMetrics aTransmissionMetrics, Integer... aValue)
      Constructs an according instance from the given configuration. The configuration attributes are taken from the TransmissionMetrics configuration object, though only those attributes are supported which are also supported by the other constructors!
      Parameters:
      aAlias - The alias which identifies the content of this instance.
      aTransmissionMetrics - The TransmissionMetrics to be used for configuring this instance.
      aValue - The payload to be contained by the IntArraySection.
    • IntArraySection

      public IntArraySection()
      Constructs an empty IntArraySection with a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the Section's value.
    • IntArraySection

      public IntArraySection(org.refcodes.numerical.Endianess aEndianess)
      Constructs an empty IntArraySection with the given Endianess.
      Parameters:
      aEndianess - The Endianess to be used for payload values.
    • IntArraySection

      public IntArraySection(int... aValue)
      Constructs a IntArraySection with the given integer array payload and a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the Section's value.
      Parameters:
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(Integer... aValue)
      Constructs a IntArraySection with the given integer array payload and a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the Section's value.
      Parameters:
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(org.refcodes.numerical.Endianess aEndianess, int... aValue)
      Constructs a IntArraySection with the given integer array payload and Endianess for the representation of the Section's value.
      Parameters:
      aEndianess - The Endianess to be used for payload values.
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(org.refcodes.numerical.Endianess aEndianess, Integer... aValue)
      Constructs a IntArraySection with the given integer array payload and Endianess for the representation of the Section's value.
      Parameters:
      aEndianess - The Endianess to be used for payload values.
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(String aAlias)
      Constructs an empty IntArraySection with a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the Section's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
    • IntArraySection

      public IntArraySection(String aAlias, org.refcodes.numerical.Endianess aEndianess)
      Constructs an empty IntArraySection with the given Endianess.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aEndianess - The Endianess to be used for payload values.
    • IntArraySection

      public IntArraySection(String aAlias, int... aValue)
      Constructs a IntArraySection with the given integer array payload and a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the Section's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(String aAlias, Integer... aValue)
      Constructs a IntArraySection with the given integer array payload and a TransmissionMetrics.DEFAULT_ENDIANESS endian representation of the Section's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(String aAlias, org.refcodes.numerical.Endianess aEndianess, int... aValue)
      Constructs a IntArraySection with the given integer array payload and Endianess for the representation of the Section's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aEndianess - The Endianess to be used for payload values.
      aValue - The payload to be contained by the Section.
    • IntArraySection

      public IntArraySection(String aAlias, org.refcodes.numerical.Endianess aEndianess, Integer... aValue)
      Constructs a IntArraySection with the given integer array payload and Endianess for the representation of the Section's value.
      Parameters:
      aAlias - The alias which identifies the content of this segment.
      aEndianess - The Endianess to be used for payload values.
      aValue - The payload to be contained by the Section.
  • Method Details

    • 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.
      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.
      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.
    • 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.
      Returns:
      The (overall) length of the Transmission (including any sub-segments).
    • toSchema

      public SerialSchema toSchema()
    • toString

      public String toString()
      Overrides:
      toString in class AbstractPayloadSection<int[]>
    • withPayload

      public IntArraySection withPayload(int[] aValue)
    • setPayload

      public void setPayload(Integer[] aPayload)
      Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking AbstractPayloadSection.setPayload(Object).
      Parameters:
      aPayload - The payload with the wrapper types.
    • withPayload

      public IntArraySection withPayload(Integer[] aPayload)
      Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking withPayload(int[]).
      Parameters:
      aPayload - The payload with the wrapper types.
      Returns:
      This instance as of the builder pattern.