java.lang.Object
org.refcodes.numerical.AbstractCrcMixin
org.refcodes.serial.CrcSegmentPackager
- All Implemented Interfaces:
org.refcodes.factory.Packager<Segment,
,Segment, RuntimeException> org.refcodes.numerical.ChecksumValidationModeAccessor
,org.refcodes.numerical.CrcAlgorithmAccessor
,org.refcodes.numerical.CrcChecksumConcatenateModeAccessor
,org.refcodes.numerical.CrcMixin
,org.refcodes.numerical.EndianessAccessor
,SegmentPackager
public class CrcSegmentPackager
extends org.refcodes.numerical.AbstractCrcMixin
implements SegmentPackager
A
CrcSegmentPackager
enriches a Segment
with a CRC checksum.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.numerical.ChecksumValidationModeAccessor
org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<B extends org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<B>>, org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeMutator, org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeProperty
Nested classes/interfaces inherited from interface org.refcodes.numerical.CrcAlgorithmAccessor
org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<B extends org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<B>>, org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmMutator, org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmProperty
Nested classes/interfaces inherited from interface org.refcodes.numerical.CrcChecksumConcatenateModeAccessor
org.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<B extends org.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<B>>, org.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeMutator, org.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeProperty
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.EndianessProperty
Nested classes/interfaces inherited from interface org.refcodes.factory.Packager
org.refcodes.factory.Packager.Extractor<PACK extends Object,
UNPACK extends Object, UNPACKEXC extends Exception>, org.refcodes.factory.Packager.PackageProcessor<UNPACK extends Object, PACK extends Object, UNPACKEXC extends Exception, PACKEXC extends Exception> Nested classes/interfaces inherited from interface org.refcodes.serial.SegmentPackager
SegmentPackager.DummySegmentPackager
-
Field Summary
Fields inherited from class org.refcodes.numerical.AbstractCrcMixin
_checksumValidationMode, _crcAlgorithm, _crcChecksumConcatenateMode, _endianess
-
Constructor Summary
ConstructorDescriptionCrcSegmentPackager
(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).CrcSegmentPackager
(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.CrcSegmentPackager
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.CrcSegmentPackager
(TransmissionMetrics aTransmissionMetrics) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum. -
Method Summary
Methods inherited from class org.refcodes.numerical.AbstractCrcMixin
equals, getChecksumValidationMode, getCrcAlgorithm, getCrcChecksumConcatenateMode, getEndianess, hashCode
-
Constructor Details
-
CrcSegmentPackager
Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum. The configuration attributes are taken from theTransmissionMetrics
configuration object, though only those attributes are supported which are also supported by the other constructors!- Parameters:
aTransmissionMetrics
- TheTransmissionMetrics
to be used for configuring this instance.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aEndianess
- TheEndianess
to use when calculating the CRC checksum.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aEndianess
- TheEndianess
to use when calculating the CRC checksum.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).- Parameters:
aCrcChecksumConcatenateMode
- The mode of concatenation to use when concatenating the CRC checksum with the transmission'sSequence
.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumConcatenateMode
- The mode of concatenation to use when concatenating the CRC checksum with the transmission'sSequence
.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum (usingTransmissionMetrics.DEFAULT_ENDIANESS
by default).- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumConcatenateMode
- The mode of concatenation to use when concatenating the CRC checksum with the transmission'sSequence
.aChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.- Parameters:
aCrcChecksumConcatenateMode
- The mode of concatenation to use when concatenating the CRC checksum with the transmission'sSequence
.aEndianess
- TheEndianess
to use when calculating the CRC checksum.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumConcatenateMode
- The mode of concatenation to use when concatenating the CRC checksum with the transmission'sSequence
.aEndianess
- TheEndianess
to use when calculating the CRC checksum.
-
CrcSegmentPackager
public CrcSegmentPackager(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode, org.refcodes.numerical.Endianess aEndianess) Constructs an accordingCrcSegmentPackager
for packaging and extracting of packets with a CRC checksum.- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.aCrcChecksumConcatenateMode
- The mode of concatenation to use when concatenating the CRC checksum with the transmission'sSequence
.aChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.aEndianess
- TheEndianess
to use when calculating the CRC checksum.
-
-
Method Details
-
toPackaged
- Specified by:
toPackaged
in interfaceorg.refcodes.factory.Packager<Segment,
Segment, RuntimeException> - Specified by:
toPackaged
in interfaceSegmentPackager
-