Serializable
, org.refcodes.mixin.AliasAccessor
, org.refcodes.mixin.LengthAccessor
, org.refcodes.mixin.PayloadAccessor<Long>
, org.refcodes.mixin.PayloadAccessor.PayloadBuilder<Long,NumberSegment>
, org.refcodes.mixin.PayloadAccessor.PayloadMutator<Long>
, org.refcodes.mixin.PayloadAccessor.PayloadProperty<Long>
, org.refcodes.mixin.ValueAccessor<Long>
, org.refcodes.mixin.ValueAccessor.ValueBuilder<Long,NumberSegment>
, org.refcodes.mixin.ValueAccessor.ValueMutator<Long>
, org.refcodes.mixin.ValueAccessor.ValueProperty<Long>
, PayloadSegment<Long>
, PayloadTransmission<Long>
, Segment
, Segment.SegmentMixin
, Transmission
, Transmission.TransmissionMixin
SequenceNumberSegment
public class NumberSegment extends AbstractPayloadSegment<Long> implements Segment, org.refcodes.mixin.ValueAccessor.ValueProperty<Long>, org.refcodes.mixin.ValueAccessor.ValueBuilder<Long,NumberSegment>
NumberSegment
is an implementation of a Segment
carrying
in long an integer value with a configurable width (in bytes) as payload.org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
org.refcodes.mixin.LengthAccessor.LengthBuilder<B extends org.refcodes.mixin.LengthAccessor.LengthBuilder<B>>, org.refcodes.mixin.LengthAccessor.LengthMutator, org.refcodes.mixin.LengthAccessor.LengthProperty
org.refcodes.mixin.PayloadAccessor.PayloadBuilder<P extends Object,B extends org.refcodes.mixin.PayloadAccessor.PayloadBuilder<P,B>>, org.refcodes.mixin.PayloadAccessor.PayloadMutator<P extends Object>, org.refcodes.mixin.PayloadAccessor.PayloadProperty<P extends Object>
Segment.SegmentMixin
Transmission.TransmissionMixin
org.refcodes.mixin.ValueAccessor.ValueBuilder<V extends Object,B extends org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B>>, org.refcodes.mixin.ValueAccessor.ValueMutator<V extends Object>, org.refcodes.mixin.ValueAccessor.ValueProperty<V extends Object>
Modifier and Type | Field | Description |
---|---|---|
static String |
ENDIANESS |
_alias, _payload
Constructor | Description |
---|---|
NumberSegment(int aNumberWidth) |
Constructs an empty
NumberSegment with a
TransmissionMetrics.DEFAULT_ENDIANESS endian representation of
the NumberSegment 's value. |
NumberSegment(int aNumberWidth,
Long aValue) |
Constructs a
NumberSegment with the given long payload and a
TransmissionMetrics.DEFAULT_ENDIANESS endian representation of
the NumberSegment 's value. |
NumberSegment(int aNumberWidth,
Long aValue,
org.refcodes.numerical.Endianess aEndianess) |
Constructs a
NumberSegment with the given long payload and the
given Endianess for the representation of the
NumberSegment 's value (payload). |
NumberSegment(int aNumberWidth,
Long aValue,
TransmissionMetrics aTransmissionMetrics) |
Constructs an according instance from the given configuration.
|
NumberSegment(int aNumberWidth,
org.refcodes.numerical.Endianess aEndianess) |
Constructs an empty
NumberSegment with the given
Endianess . |
NumberSegment(int aNumberWidth,
TransmissionMetrics aTransmissionMetrics) |
Constructs an according instance from the given configuration.
|
NumberSegment(String aAlias,
int aNumberWidth) |
Constructs an empty
NumberSegment with a
TransmissionMetrics.DEFAULT_ENDIANESS endian representation of
the NumberSegment 's value. |
NumberSegment(String aAlias,
int aNumberWidth,
Long aValue) |
Constructs a
NumberSegment with the given long payload and a
TransmissionMetrics.DEFAULT_ENDIANESS endian representation of
the NumberSegment 's value. |
NumberSegment(String aAlias,
int aNumberWidth,
Long aValue,
org.refcodes.numerical.Endianess aEndianess) |
Constructs a
NumberSegment with the given long payload and the
given Endianess for the representation of the
NumberSegment 's value (payload). |
NumberSegment(String aAlias,
int aNumberWidth,
org.refcodes.numerical.Endianess aEndianess) |
Constructs an empty
NumberSegment with the given
Endianess . |
NumberSegment(String aAlias,
int aNumberWidth,
TransmissionMetrics aTransmissionMetrics) |
Constructs an according instance from the given configuration.
|
Modifier and Type | Method | Description |
---|---|---|
int |
fromTransmission(Sequence aSequence,
int aOffset) |
(Re-)initializes this instance with the the given
Sequence data. |
int |
getLength() |
Determines the overall length of this
Transmission . |
Long |
getValue() |
|
void |
setValue(Long aValue) |
|
Schema |
toSchema() |
Retrieves the
Schema representing the Transmission . |
Sequence |
toTransmission() |
Provides the
Sequence representation of this
Transmission . |
NumberSegment |
withPayload(Long aValue) |
|
NumberSegment |
withValue(Long aValue) |
equals, getAlias, getPayload, hashCode, setPayload, toSimpleTypeMap, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFrom, receiveFrom
receiveFrom
fromInputStream, toSimpleTypeMap, transmitTo, transmitTo, transmitTo
transmitTo
public static final String ENDIANESS
public NumberSegment(int aNumberWidth, TransmissionMetrics aTransmissionMetrics)
TransmissionMetrics
configuration object, though only those attributes are supported which
are also supported by the other constructors!aNumberWidth
- The number of bytes to be occupied by the number.aTransmissionMetrics
- The TransmissionMetrics
to be used
for configuring this instance.public NumberSegment(int aNumberWidth, Long aValue, TransmissionMetrics aTransmissionMetrics)
TransmissionMetrics
configuration object, though only those attributes are supported which
are also supported by the other constructors!aNumberWidth
- The number of bytes to be occupied by the number.aValue
- The payload to be contained by the
DoubleArraySection
.aTransmissionMetrics
- The TransmissionMetrics
to be used
for configuring this instance.public NumberSegment(String aAlias, int aNumberWidth, TransmissionMetrics aTransmissionMetrics)
TransmissionMetrics
configuration object, though only those attributes are supported which
are also supported by the other constructors!aAlias
- The alias which identifies the content of this instance.aNumberWidth
- The number of bytes to be occupied by the number.aTransmissionMetrics
- The TransmissionMetrics
to be used
for configuring this instance.public NumberSegment(int aNumberWidth)
NumberSegment
with a
TransmissionMetrics.DEFAULT_ENDIANESS
endian representation of
the NumberSegment
's value.aNumberWidth
- The number of bytes to be occupied by the number.public NumberSegment(int aNumberWidth, org.refcodes.numerical.Endianess aEndianess)
NumberSegment
with the given
Endianess
.aNumberWidth
- The number of bytes to be occupied by the number.aEndianess
- The Endianess
to be used for payload values.public NumberSegment(int aNumberWidth, Long aValue)
NumberSegment
with the given long payload and a
TransmissionMetrics.DEFAULT_ENDIANESS
endian representation of
the NumberSegment
's value.aNumberWidth
- The number of bytes to be occupied by the number.aValue
- The payload to be contained by the NumberSegment
.public NumberSegment(int aNumberWidth, Long aValue, org.refcodes.numerical.Endianess aEndianess)
NumberSegment
with the given long payload and the
given Endianess
for the representation of the
NumberSegment
's value (payload).aNumberWidth
- The number of bytes to be occupied by the number.aValue
- The value (payload) to be contained by the
NumberSegment
.aEndianess
- The Endianess
to be used for payload values.public NumberSegment(String aAlias, int aNumberWidth)
NumberSegment
with a
TransmissionMetrics.DEFAULT_ENDIANESS
endian representation of
the NumberSegment
's value.aAlias
- The alias which identifies the content of this segment.aNumberWidth
- The number of bytes to be occupied by the number.public NumberSegment(String aAlias, int aNumberWidth, org.refcodes.numerical.Endianess aEndianess)
NumberSegment
with the given
Endianess
.aAlias
- The alias which identifies the content of this segment.aNumberWidth
- The number of bytes to be occupied by the number.aEndianess
- The Endianess
to be used for payload values.public NumberSegment(String aAlias, int aNumberWidth, Long aValue)
NumberSegment
with the given long payload and a
TransmissionMetrics.DEFAULT_ENDIANESS
endian representation of
the NumberSegment
's value.aAlias
- The alias which identifies the content of this segment.aNumberWidth
- The number of bytes to be occupied by the number.aValue
- The payload to be contained by the NumberSegment
.public NumberSegment(String aAlias, int aNumberWidth, Long aValue, org.refcodes.numerical.Endianess aEndianess)
NumberSegment
with the given long payload and the
given Endianess
for the representation of the
NumberSegment
's value (payload).aAlias
- The alias which identifies the content of this segment.aNumberWidth
- The number of bytes to be occupied by the number.aValue
- The value (payload) to be contained by the
NumberSegment
.aEndianess
- The Endianess
to be used for payload values.public Sequence toTransmission()
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.toTransmission
in interface Transmission
Sequence
.public int fromTransmission(Sequence aSequence, int aOffset) throws TransmissionException
Sequence
data.fromTransmission
in interface Segment
aSequence
- The Sequence
data from which to (re-)initialize
this instance.aOffset
- The offset where to start processing the provided
Sequence
.Sequence
processed by this method.TransmissionException
- thrown in case a given Sequence
cannot be processed.public int getLength()
Transmission
. In case of
nested Transmission
instances, all length values from all
sub-segments are accumulated to the result as well.getLength
in interface org.refcodes.mixin.LengthAccessor
getLength
in interface Transmission
Transmission
(including any
sub-segments).public Schema toSchema()
Schema
representing the Transmission
.
Retrieving a Schema
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
.toSchema
in interface Transmission
Schema
representation of the implementing type for
debugging and verification (or documentation) purposes.public NumberSegment withPayload(Long aValue)
withPayload
in interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder<Long,NumberSegment>
public Long getValue()
getValue
in interface org.refcodes.mixin.ValueAccessor<Long>
public void setValue(Long aValue)
setValue
in interface org.refcodes.mixin.ValueAccessor.ValueMutator<Long>
public NumberSegment withValue(Long aValue)
withValue
in interface org.refcodes.mixin.ValueAccessor.ValueBuilder<Long,NumberSegment>
Copyright © 2021. All rights reserved.