Class FloatArraySection

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

public class FloatArraySection extends AbstractPayloadSection<float[]> implements PayloadSection<float[]>
The FloatArraySection is an implementation of a Section carrying a float array as payload.
See Also:
  • Field Details

  • Constructor Details

    • FloatArraySection

      public FloatArraySection(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.
    • FloatArraySection

      public FloatArraySection(TransmissionMetrics aTransmissionMetrics, float... 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 FloatArraySection.
    • FloatArraySection

      public FloatArraySection(TransmissionMetrics aTransmissionMetrics, Float... 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 FloatArraySection.
    • FloatArraySection

      public FloatArraySection(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.
    • FloatArraySection

      public FloatArraySection(String aAlias, TransmissionMetrics aTransmissionMetrics, float... 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 FloatArraySection.
    • FloatArraySection

      public FloatArraySection(String aAlias, TransmissionMetrics aTransmissionMetrics, Float... 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 FloatArraySection.
    • FloatArraySection

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

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

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

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

      public FloatArraySection(org.refcodes.numerical.Endianess aEndianess, float... aValue)
      Constructs a FloatArraySection with the given float 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.
    • FloatArraySection

      public FloatArraySection(org.refcodes.numerical.Endianess aEndianess, Float... aValue)
      Constructs a FloatArraySection with the given float 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.
    • FloatArraySection

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

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

      public FloatArraySection(String aAlias, float... aValue)
      Constructs a FloatArraySection with the given float 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.
    • FloatArraySection

      public FloatArraySection(String aAlias, Float... aValue)
      Constructs a FloatArraySection with the given float 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.
    • FloatArraySection

      public FloatArraySection(String aAlias, org.refcodes.numerical.Endianess aEndianess, float... aValue)
      Constructs a FloatArraySection with the given float 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.
    • FloatArraySection

      public FloatArraySection(String aAlias, org.refcodes.numerical.Endianess aEndianess, Float... aValue)
      Constructs a FloatArraySection with the given float 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.
      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.
    • 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).
    • 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.
    • toString

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

      public FloatArraySection withPayload(float[] aValue)
      Specified by:
      withPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder<float[],PayloadTransmission<float[]>>
    • setPayload

      public void setPayload(Float[] 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 FloatArraySection withPayload(Float[] aPayload)
      Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking withPayload(float[]).
      Parameters:
      aPayload - The payload with the wrapper types.
      Returns:
      This instance as of the builder pattern.