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,ArrayTransmission<ARRAY>,Transmission
- Direct Known Subclasses:
FixedSegmentArraySection,SegmentArraySection
public abstract class AbstractArrayTransmission<ARRAY extends Transmission> extends Object implements Transmission, ArrayTransmission<ARRAY>
AnAbstractArrayTransmissionis aTransmissionconsisting ofTransmissionelements (an array of elements).- See Also:
- Serialized Form
-
-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractArrayTransmission(ARRAY... aSegments)Constructs an according instance with the givenSegmentelements.AbstractArrayTransmission(Class<ARRAY> aSegmentClass)Constructs an according instance with instances of the array being created using the providedClassinstance.AbstractArrayTransmission(String aAlias, ARRAY... aSegments)Constructs an according instance with the givenSegmentelements.AbstractArrayTransmission(String aAlias, Class<ARRAY> aSegmentClass)Constructs an according instance with instances of the array being created using the providedClassinstance.AbstractArrayTransmission(String aAlias, Collection<ARRAY> aSegments)Constructs an according instance with the givenSegmentelements.AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory)Constructs an according instance with instances of the array being created using the providedTypeFactoryinstance.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 givenSegmentelements.AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory)Constructs an according instance with instances of the array being created using the providedTypeFactoryinstance.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAlias()ARRAY[]getArray()intgetLength()Determines the overall length of thisTransmission.voidsetArray(ARRAY[] aValue)SchematoSchema()Retrieves theSchemarepresenting theTransmission.StringtoString()AbstractArrayTransmission<ARRAY>withArray(ARRAY[] aValue)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.serial.ArrayTransmission
toSequence, toSimpleTypeMap
-
Methods inherited from interface org.refcodes.serial.Transmission
transmitTo, transmitTo, transmitTo
-
-
-
-
Field Detail
-
_array
protected ARRAY extends Transmission[] _array
-
_sequenceableFactory
protected org.refcodes.factory.TypeFactory<ARRAY extends Transmission> _sequenceableFactory
-
_alias
protected String _alias
-
-
Constructor Detail
-
AbstractArrayTransmission
public AbstractArrayTransmission(ARRAY... aSegments)
Constructs an according instance with the givenSegmentelements.Segmentinstances for the array are created using the provided array's component type.- Parameters:
aSegments- The array containing the accordingSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(Collection<ARRAY> aSegments)
Constructs an according instance with the givenSegmentelements.Segmentinstances for the array are created using the provided array's component type.- Parameters:
aSegments- The collection containing the accordingSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, ARRAY... aSegments)
Constructs an according instance with the given elements.Segmentinstances for the array are created using the providedTypeFactoryinstance.
-
AbstractArrayTransmission
public AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, Collection<ARRAY> aSegments)
Constructs an according instance with the given elements.Segmentinstances for the array are created using the providedTypeFactoryinstance.
-
AbstractArrayTransmission
public AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory)
Constructs an according instance with instances of the array being created using the providedTypeFactoryinstance.- Parameters:
aSegmentFactory- The factory producing the the fixed lengthSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(Class<ARRAY> aSegmentClass)
Constructs an according instance with instances of the array being created using the providedClassinstance.- Parameters:
aSegmentClass- The class from which to produce the the fixed lengthSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, ARRAY... aSegments)
Constructs an according instance with the givenSegmentelements.Segmentinstances 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 accordingSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, Collection<ARRAY> aSegments)
Constructs an according instance with the givenSegmentelements.Segmentinstances 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 accordingSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, ARRAY... aSegments)
Constructs an according instance with the given elements.Segmentinstances for the array are created using the providedTypeFactoryinstance.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory, Collection<ARRAY> aSegments)
Constructs an according instance with the given elements.Segmentinstances for the array are created using the providedTypeFactoryinstance.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory)
Constructs an according instance with instances of the array being created using the providedTypeFactoryinstance.- Parameters:
aAlias- The alias which identifies the content of this segment.aSegmentFactory- The factory producing the the fixed lengthSegmentelements.
-
AbstractArrayTransmission
public AbstractArrayTransmission(String aAlias, Class<ARRAY> aSegmentClass)
Constructs an according instance with instances of the array being created using the providedClassinstance.- Parameters:
aAlias- The alias which identifies the content of this segment.aSegmentClass- The class from which to produce the the fixed lengthSegmentelements.
-
-
Method Detail
-
toSchema
public Schema toSchema()
Retrieves theSchemarepresenting theTransmission. Retrieving aSchemais useful when analyzing and debugging data structures such as aAllocSectionDecoratorSegmentinstance to help document, learn and verify on the structure (as well as the content) of that veryAllocSectionDecoratorSegment.- Specified by:
toSchemain interfaceArrayTransmission<ARRAY extends Transmission>- Specified by:
toSchemain interfaceTransmission- Returns:
- The
Schemarepresentation of the implementing type for debugging and verification (or documentation) purposes.
-
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 interfaceArrayTransmission<ARRAY extends Transmission>- Specified by:
getLengthin interfaceorg.refcodes.mixin.LengthAccessor- Specified by:
getLengthin interfaceTransmission- Returns:
- The (overall) length of the
Transmission(including any sub-segments).
-
getArray
public ARRAY[] getArray()
- Specified by:
getArrayin interfaceorg.refcodes.mixin.ArrayAccessor<ARRAY extends Transmission>
-
setArray
public void setArray(ARRAY[] aValue)
- Specified by:
setArrayin interfaceorg.refcodes.mixin.ArrayAccessor.ArrayMutator<ARRAY extends Transmission>
-
withArray
public AbstractArrayTransmission<ARRAY> withArray(ARRAY[] aValue)
- Specified by:
withArrayin interfaceorg.refcodes.mixin.ArrayAccessor.ArrayBuilder<ARRAY extends Transmission[],ArrayTransmission<ARRAY extends Transmission>>
-
getAlias
public String getAlias()
- Specified by:
getAliasin interfaceorg.refcodes.mixin.AliasAccessor
-
-