java.lang.Object
org.refcodes.serial.DynamicTypeSegment
- All Implemented Interfaces:
Serializable,org.refcodes.mixin.EncodingAccessor<Charset>,org.refcodes.mixin.LengthAccessor,org.refcodes.mixin.Resetable,org.refcodes.numerical.EndianessAccessor,org.refcodes.schema.Schemable,DynamicTypeTransmission,LengthWidthAccessor,Segment,Transmission
public class DynamicTypeSegment
extends Object
implements Segment, LengthWidthAccessor, org.refcodes.numerical.EndianessAccessor, org.refcodes.mixin.EncodingAccessor<Charset>, DynamicTypeTransmission
The
DynamicTypeSegment represents a Segment which's internal
raw data is created from provided types at runtime and which's internal raw
data is used to create provided types at runtime. It is implemented by
decorating a DynamicTypeSection with an
AllocSectionDecoratorSegment.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.EncodingAccessor
org.refcodes.mixin.EncodingAccessor.EncodingBuilder<E extends Object,B extends org.refcodes.mixin.EncodingAccessor.EncodingBuilder<E, B>>, org.refcodes.mixin.EncodingAccessor.EncodingMutator<E extends Object>, org.refcodes.mixin.EncodingAccessor.EncodingProperty<E extends Object> Nested classes/interfaces inherited from interface org.refcodes.numerical.EndianessAccessor
org.refcodes.numerical.EndianessAccessor.EndianessBuilder<B extends org.refcodes.numerical.EndianessAccessor.EndianessBuilder<B>>, org.refcodes.numerical.EndianessAccessor.EndianessMutator, org.refcodes.numerical.EndianessAccessor.EndianessPropertyNested 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.LengthWidthAccessor
LengthWidthAccessor.LengthWidthBuilder<B extends LengthWidthAccessor.LengthWidthBuilder<B>>, LengthWidthAccessor.LengthWidthMutator, LengthWidthAccessor.LengthWidthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Segment
Segment.SegmentMixinNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Constructor Summary
ConstructorsConstructorDescriptionConstructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).DynamicTypeSegment(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.DynamicTypeSegment(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(String aAlias) Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).DynamicTypeSegment(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.DynamicTypeSegment(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(String aAlias, Charset aCharset) Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS.DynamicTypeSegment(String aAlias, TransmissionMetrics aTransmissionMetrics) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(String aAlias, T aValue) Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(String aAlias, T aValue, String... aAttributes) Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).DynamicTypeSegment(String aAlias, T aValue, Charset aCharset) Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS.DynamicTypeSegment(String aAlias, T aValue, Charset aCharset, String... aAttributes) Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS.DynamicTypeSegment(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(Charset aCharset) Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS.DynamicTypeSegment(TransmissionMetrics aTransmissionMetrics) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(T aValue) Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(T aValue, String... aAttributes) Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).DynamicTypeSegment(T aValue, Charset aCharset) Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS.DynamicTypeSegment(T aValue, Charset aCharset, String... aAttributes) Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS.DynamicTypeSegment(T aValue, TransmissionMetrics aTransmissionMetrics) Constructs theDynamicTypeSegmentwith the given properties.DynamicTypeSegment(T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties. -
Method Summary
Modifier and TypeMethodDescriptionintfromTransmission(Sequence aSequence, int aOffset) (Re-)initializes this instance with the the givenSequencedata.<T> voidfromType(T aValue) Constructs theDynamicTypeSection'sSequencefrom the given type's instance .<T> voidConstructs an instance for the given type T. .org.refcodes.numerical.EndianessintDetermines the overall length of thisTransmission.intRetrieves the length width (in bytes) from the length width (in bytes) property.voidreceiveFrom(InputStream aInputStream, OutputStream aReturnStream) (Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream.voidreset()Resets any dynamic data (e.g. values such as payloads or checksums) and must not(!)toSchema()Provides theSequencerepresentation of thisTransmission.org.refcodes.struct.SimpleTypeMapReturns theSimpleTypeMaprepresentation of thisTransmission.<T> TConstructs an instance for the given type T.<T> TConstructs an instance for the given type T. .voidtransmitTo(OutputStream aOutputStream, InputStream aReturnStream) Transmits theSequencerepresenting the implementing type's instance to the givenOutputStream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.serial.Segment
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFromMethods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo
-
Constructor Details
-
DynamicTypeSegment
public DynamicTypeSegment()Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING). -
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS. -
DynamicTypeSegment
public DynamicTypeSegment(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.- Parameters:
aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.
-
DynamicTypeSegment
public DynamicTypeSegment(int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties. -
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING).- Parameters:
aAlias- The alias which identifies the content of this segment.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS. -
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING.- Parameters:
aAlias- The alias which identifies the content of this segment.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.
-
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties. -
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING). It is pre-initialized with the given value as offromType(Object).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS. It is pre-initialized with the given value as offromType(Object). -
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS. It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aCharset- TheCharsetto be used for encoding and decodingStringinstances.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING. It is pre-initialized with the given value as offromType(Object).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.
-
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.aCharset- TheCharsetto be used for encoding and decodingStringinstances.
-
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.aCharset- TheCharsetto be used for encoding and decodingStringinstances.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING. It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING). It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object). The configuration attributes are taken from theTransmissionMetricsconfiguration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.
-
DynamicTypeSegment
public DynamicTypeSegment(String aAlias, T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object, String...). The configuration attributes are taken from theTransmissionMetricsconfiguration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aAlias- The alias which identifies the content of this segment.aValue- The data structure's value.aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the given properties. The configuration attributes are taken from theTransmissionMetricsconfiguration 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 segment.aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.
-
DynamicTypeSegment
public DynamicTypeSegment(T aValue) Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING). It is pre-initialized with the given value as offromType(Object).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS. It is pre-initialized with the given value as offromType(Object). -
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the givenCharSection, as well as with theTransmissionMetrics.DEFAULT_LENGTH_WIDTHand theTransmissionMetrics.DEFAULT_ENDIANESS. It is pre-initialized with the given value as offromType(Object, String...). -
DynamicTypeSegment
public DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING. It is pre-initialized with the given value as offromType(Object).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.
-
DynamicTypeSegment
public DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset) Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.aCharset- TheCharsetto be used for encoding and decodingStringinstances.
-
DynamicTypeSegment
public DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, Charset aCharset, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.aCharset- TheCharsetto be used for encoding and decodingStringinstances.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
public DynamicTypeSegment(T aValue, int aLengthWidth, org.refcodes.numerical.Endianess aEndianess, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties as well as with theTransmissionMetrics.DEFAULT_ENCODING. It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aLengthWidth- The width (in bytes) to be used for length values.aEndianess- TheEndianessto be used for (length) values.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the default properties (TransmissionMetrics.DEFAULT_LENGTH_WIDTH,TransmissionMetrics.DEFAULT_ENDIANESSas well asTransmissionMetrics.DEFAULT_ENCODING). It is pre-initialized with the given value as offromType(Object, String...).- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object). The configuration attributes are taken from theTransmissionMetricsconfiguration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.
-
DynamicTypeSegment
public DynamicTypeSegment(T aValue, TransmissionMetrics aTransmissionMetrics, String... aAttributes) Constructs theDynamicTypeSegmentwith the given properties. It is pre-initialized with the given value as offromType(Object, String...). The configuration attributes are taken from theTransmissionMetricsconfiguration object, though only those attributes are supported which are also supported by the other constructors!- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
DynamicTypeSegment
Constructs theDynamicTypeSegmentwith the given properties. The configuration attributes are taken from theTransmissionMetricsconfiguration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aTransmissionMetrics- TheTransmissionMetricsto be used for configuring this instance.
-
-
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.
-
transmitTo
Transmits theSequencerepresenting the implementing type's instance to the givenOutputStream. Implementations providing error correction methods use the provided feedbackInputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the transmitted data.- Specified by:
transmitToin interfaceTransmission- Parameters:
aOutputStream- TheOutputStreamwhere to write this instance'sSequenceto.aReturnStream- AnInputStreambeing the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.- Throws:
IOException- thrown in case writing data to theOutputStreamcaused problems.
-
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
-
toSchema
- Specified by:
toSchemain interfaceorg.refcodes.schema.Schemable- Specified by:
toSchemain interfaceTransmission
-
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.
-
toType
Constructs an instance for the given type T. The attributes of the given data structure are processed all and in alphabetical order. For specifying a predefined set of attributes and their order, please invokeDynamicTypeTransmission.fromType(Object, String...)instead!- Specified by:
toTypein interfaceDynamicTypeTransmission- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aType- The data structure's type.- Returns:
- The according type constructed from the
DynamicTypeSection'sSequence.
-
toType
Constructs an instance for the given type T. . The attributes of the given data structure are processed using the predefined set of attributes in their according order- Specified by:
toTypein interfaceDynamicTypeTransmission- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aType- The data structure's type.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.- Returns:
- The according type constructed from the
DynamicTypeSection'sSequence.
-
fromType
public <T> void fromType(T aValue) Constructs theDynamicTypeSection'sSequencefrom the given type's instance . The attributes of the given data structure are processed all and in alphabetical order. For specifying a predefined set of attributes and their order, please invokeDynamicTypeTransmission.fromType(Object, String[])instead!- Specified by:
fromTypein interfaceDynamicTypeTransmission- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.
-
fromType
Constructs an instance for the given type T. . The attributes of the given data structure are processed using the predefined set of attributes in their according order.- Specified by:
fromTypein interfaceDynamicTypeTransmission- Type Parameters:
T- The type of the data structure representing the body.- Parameters:
aValue- The data structure's value.aAttributes- The attributes or null if all attributes are to be processed in alphabetical order.
-
getEncoding
- Specified by:
getEncodingin interfaceorg.refcodes.mixin.EncodingAccessor<Charset>
-
getEndianess
public org.refcodes.numerical.Endianess getEndianess()- Specified by:
getEndianessin interfaceorg.refcodes.numerical.EndianessAccessor
-
getLengthWidth
public int getLengthWidth()Retrieves the length width (in bytes) from the length width (in bytes) property.- Specified by:
getLengthWidthin interfaceLengthWidthAccessor- Returns:
- The length width (in bytes) stored by the length width (in bytes) property.
-
fromTransmission
(Re-)initializes this instance with the the givenSequencedata.- Specified by:
fromTransmissionin interfaceSegment- Parameters:
aSequence- TheSequencedata from which to (re-)initialize this instance.aOffset- The offset where to start processing the providedSequence.- Returns:
- The index after the last offset into the given
Sequenceprocessed by this method. - Throws:
TransmissionException- thrown in case a givenSequencecannot be processed.
-
receiveFrom
(Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream. Implementations providing error correction methods use the provided feedbackOutputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the received data.- Specified by:
receiveFromin interfaceSegment- Parameters:
aInputStream- TheInputStreamfrom which to read the instance's (re-)initializationSequencefrom.aReturnStream- AnOutputStreambeing the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.- Throws:
IOException- thrown in case reading data from theInputStreamcaused problems.TransmissionException- thrown in case a given transmission cannot be processed.
-