Module org.refcodes.serial
Package org.refcodes.serial
Class AbstractArrayTransmission<ARRAY extends Transmission>
java.lang.Object
org.refcodes.serial.AbstractArrayTransmission<ARRAY>
- Type Parameters:
ARRAY
- The type of the array elements to be contained in this instance.
- All Implemented Interfaces:
Serializable
,org.refcodes.mixin.AliasAccessor
,org.refcodes.mixin.ArrayAccessor<ARRAY[]>
,org.refcodes.mixin.ArrayAccessor.ArrayBuilder<ARRAY[],
,ArrayTransmission<ARRAY>> org.refcodes.mixin.ArrayAccessor.ArrayMutator<ARRAY[]>
,org.refcodes.mixin.ArrayAccessor.ArrayProperty<ARRAY[]>
,org.refcodes.mixin.LengthAccessor
,org.refcodes.mixin.Schemable
,ArrayTransmission<ARRAY>
,Transmission
- Direct Known Subclasses:
FixedSegmentArraySection
,SegmentArraySection
public abstract class AbstractArrayTransmission<ARRAY extends Transmission>
extends Object
implements Transmission, ArrayTransmission<ARRAY>
An
AbstractArrayTransmission
is a Transmission
consisting of
Transmission
elements (an array of elements).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.ArrayAccessor
org.refcodes.mixin.ArrayAccessor.ArrayBuilder<T extends Object,
B extends org.refcodes.mixin.ArrayAccessor.ArrayBuilder<T, B>>, org.refcodes.mixin.ArrayAccessor.ArrayMutator<T extends Object>, org.refcodes.mixin.ArrayAccessor.ArrayProperty<T extends Object> Nested 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.LengthProperty
Nested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractArrayTransmission
(ARRAY... aSegments) Constructs an according instance with the givenSegment
elements.AbstractArrayTransmission
(Class<ARRAY> aSegmentClass) Constructs an according instance with instances of the array being created using the providedClass
instance.AbstractArrayTransmission
(String aAlias, ARRAY... aSegments) Constructs an according instance with the givenSegment
elements.AbstractArrayTransmission
(String aAlias, Class<ARRAY> aSegmentClass) Constructs an according instance with instances of the array being created using the providedClass
instance.AbstractArrayTransmission
(String aAlias, Collection<ARRAY> aSegments) Constructs an according instance with the givenSegment
elements.AbstractArrayTransmission
(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory) Constructs an according instance with instances of the array being created using the providedTypeFactory
instance.AbstractArrayTransmission
(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, ARRAY... aSegments) Constructs an according instance with the given elements.AbstractArrayTransmission
(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, Collection<ARRAY> aSegments) Constructs an according instance with the given elements.AbstractArrayTransmission
(Collection<ARRAY> aSegments) Constructs an according instance with the givenSegment
elements.AbstractArrayTransmission
(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory) Constructs an according instance with instances of the array being created using the providedTypeFactory
instance.AbstractArrayTransmission
(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, ARRAY... aSegments) Constructs an according instance with the given elements.AbstractArrayTransmission
(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, Collection<ARRAY> aSegments) Constructs an according instance with the given elements. -
Method Summary
Modifier and TypeMethodDescriptiongetAlias()
ARRAY[]
getArray()
int
Determines the overall length of thisTransmission
.void
toSchema()
Retrieves theSerialSchema
representing theTransmission
.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.ArrayAccessor.ArrayProperty
letArray
Methods inherited from interface org.refcodes.serial.ArrayTransmission
toSequence, toSimpleTypeMap
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo, transmitTo
-
Field Details
-
_array
-
_sequenceableFactory
-
_alias
-
-
Constructor Details
-
AbstractArrayTransmission
Constructs an according instance with the givenSegment
elements.Segment
instances for the array are created using the provided array's component type.- Parameters:
aSegments
- The array containing the accordingSegment
elements.
-
AbstractArrayTransmission
Constructs an according instance with the givenSegment
elements.Segment
instances for the array are created using the provided array's component type.- Parameters:
aSegments
- The collection containing the accordingSegment
elements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, ARRAY... aSegments) Constructs an according instance with the given elements.Segment
instances for the array are created using the providedTypeFactory
instance. -
AbstractArrayTransmission
public AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, Collection<ARRAY> aSegments) Constructs an according instance with the given elements.Segment
instances for the array are created using the providedTypeFactory
instance. -
AbstractArrayTransmission
Constructs an according instance with instances of the array being created using the providedTypeFactory
instance.- Parameters:
aSegmentFactory
- The factory producing the the fixed lengthSegment
elements.
-
AbstractArrayTransmission
Constructs an according instance with instances of the array being created using the providedClass
instance.- Parameters:
aSegmentClass
- The class from which to produce the the fixed lengthSegment
elements.
-
AbstractArrayTransmission
Constructs an according instance with the givenSegment
elements.Segment
instances for the array are created using the provided array's component type.- Parameters:
aAlias
- The alias which identifies the content of this segment.aSegments
- The array containing the accordingSegment
elements.
-
AbstractArrayTransmission
Constructs an according instance with the givenSegment
elements.Segment
instances for the array are created using the provided array's component type.- Parameters:
aAlias
- The alias which identifies the content of this segment.aSegments
- The collection containing the accordingSegment
elements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, ARRAY... aSegments) Constructs an according instance with the given elements.Segment
instances for the array are created using the providedTypeFactory
instance. -
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, Collection<ARRAY> aSegments) Constructs an according instance with the given elements.Segment
instances for the array are created using the providedTypeFactory
instance. -
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory) Constructs an according instance with instances of the array being created using the providedTypeFactory
instance.- Parameters:
aAlias
- The alias which identifies the content of this segment.aSegmentFactory
- The factory producing the the fixed lengthSegment
elements.
-
AbstractArrayTransmission
Constructs an according instance with instances of the array being created using the providedClass
instance.- Parameters:
aAlias
- The alias which identifies the content of this segment.aSegmentClass
- The class from which to produce the the fixed lengthSegment
elements.
-
-
Method Details
-
toSchema
Retrieves theSerialSchema
representing theTransmission
. Retrieving aSerialSchema
is useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegment
instance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment
.- Specified by:
toSchema
in interfaceArrayTransmission<ARRAY extends Transmission>
- Specified by:
toSchema
in interfaceorg.refcodes.mixin.Schemable
- Specified by:
toSchema
in interfaceTransmission
- Returns:
- The
SerialSchema
representation of the implementing type for debugging and verification (or documentation) purposes.
-
getLength
public int getLength()Determines the overall length of thisTransmission
. In case of nestedTransmission
instances, all length values from all sub-segments are accumulated to the result as well.- Specified by:
getLength
in interfaceArrayTransmission<ARRAY extends Transmission>
- Specified by:
getLength
in interfaceorg.refcodes.mixin.LengthAccessor
- Specified by:
getLength
in interfaceTransmission
- Returns:
- The (overall) length of the
Transmission
(including any sub-segments).
-
getArray
- Specified by:
getArray
in interfaceorg.refcodes.mixin.ArrayAccessor<ARRAY extends Transmission>
-
setArray
- Specified by:
setArray
in interfaceorg.refcodes.mixin.ArrayAccessor.ArrayMutator<ARRAY extends Transmission>
-
withArray
- Specified by:
withArray
in interfaceorg.refcodes.mixin.ArrayAccessor.ArrayBuilder<ARRAY extends Transmission[],
ArrayTransmission<ARRAY extends Transmission>>
-
getAlias
- Specified by:
getAlias
in interfaceorg.refcodes.mixin.AliasAccessor
-
toString
-