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>
AnAbstractArrayTransmission
is aTransmission
consisting ofTransmission
elements (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 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlias()
ARRAY[]
getArray()
int
getLength()
Determines the overall length of thisTransmission
.void
setArray(ARRAY[] aValue)
Schema
toSchema()
Retrieves theSchema
representing theTransmission
.String
toString()
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 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
public AbstractArrayTransmission(Collection<ARRAY> aSegments)
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
public AbstractArrayTransmission(org.refcodes.factory.TypeFactory<ARRAY> aSegmentFactory)
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
public AbstractArrayTransmission(Class<ARRAY> aSegmentClass)
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
public AbstractArrayTransmission(String aAlias, ARRAY... aSegments)
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
public AbstractArrayTransmission(String aAlias, Collection<ARRAY> aSegments)
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
public AbstractArrayTransmission(String aAlias, Class<ARRAY> aSegmentClass)
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 Detail
-
toSchema
public Schema toSchema()
Retrieves theSchema
representing theTransmission
. Retrieving aSchema
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 interfaceTransmission
- Returns:
- The
Schema
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
public ARRAY[] getArray()
- Specified by:
getArray
in interfaceorg.refcodes.mixin.ArrayAccessor<ARRAY extends Transmission>
-
setArray
public void setArray(ARRAY[] aValue)
- Specified by:
setArray
in interfaceorg.refcodes.mixin.ArrayAccessor.ArrayMutator<ARRAY extends Transmission>
-
withArray
public AbstractArrayTransmission<ARRAY> withArray(ARRAY[] aValue)
- Specified by:
withArray
in interfaceorg.refcodes.mixin.ArrayAccessor.ArrayBuilder<ARRAY extends Transmission[],ArrayTransmission<ARRAY extends Transmission>>
-
getAlias
public String getAlias()
- Specified by:
getAlias
in interfaceorg.refcodes.mixin.AliasAccessor
-
-