Module org.refcodes.serial
Package org.refcodes.serial
Class SegmentComposite<CHILD extends Segment>
java.lang.Object
org.refcodes.serial.AbstractTransmissionComposite<CHILD>
org.refcodes.serial.SegmentComposite<CHILD>
- Type Parameters:
CHILD- The type of the child elements to be contained in this instance.
- All Implemented Interfaces:
Serializable,Iterable<CHILD>,org.refcodes.mixin.ChildrenAccessor<CHILD[]>,org.refcodes.mixin.LengthAccessor,org.refcodes.mixin.Resetable,org.refcodes.schema.Schemable,Segment,Segment.SegmentMixin,Transmission,Transmission.TransmissionMixin,TransmissionComposite<CHILD>
- Direct Known Subclasses:
ComplexTypeSegment
public class SegmentComposite<CHILD extends Segment>
extends AbstractTransmissionComposite<CHILD>
implements Segment, Segment.SegmentMixin
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ChildrenAccessor
org.refcodes.mixin.ChildrenAccessor.ChildrenBuilder<T extends Object,B extends org.refcodes.mixin.ChildrenAccessor.ChildrenBuilder<T, B>>, org.refcodes.mixin.ChildrenAccessor.ChildrenMutator<T extends Object>, org.refcodes.mixin.ChildrenAccessor.ChildrenProperty<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.LengthPropertyNested classes/interfaces inherited from interface org.refcodes.serial.Segment
Segment.SegmentMixinNested classes/interfaces inherited from interface org.refcodes.serial.Transmission
Transmission.TransmissionMixin -
Field Summary
Fields inherited from class org.refcodes.serial.AbstractTransmissionComposite
_children -
Constructor Summary
ConstructorsConstructorDescriptionSegmentComposite(CHILD... aSegments) SegmentComposite(Collection<CHILD> aSegments) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintfromTransmission(Sequence aSequence, int aOffset) (Re-)initializes this instance with the the givenSequencedata.inthashCode()voidreceiveFrom(InputStream aInputStream, OutputStream aReturnStream) (Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream.toSchema()toString()Methods inherited from class org.refcodes.serial.AbstractTransmissionComposite
getChildren, iterator, resetMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.refcodes.serial.Segment
fromTransmission, fromTransmission, fromTransmission, receiveFrom, receiveFromMethods inherited from interface org.refcodes.serial.Transmission
reset, transmitTo, transmitToMethods inherited from interface org.refcodes.serial.Transmission.TransmissionMixin
transmitToMethods inherited from interface org.refcodes.serial.TransmissionComposite
getLength, toSequence, toSimpleTypeMap
-
Constructor Details
-
SegmentComposite
-
SegmentComposite
-
-
Method Details
-
fromTransmission
(Re-)initializes this instance with the the givenSequencedata.- Specified by:
fromTransmissionin interfaceSegment- Parameters:
aSequence- TheSequencedata from which to (re-)initialize this instance.aOffset- The offset where to start processing the providedSequence.- Returns:
- The index after the last offset into the given
Sequenceprocessed by this method. - Throws:
TransmissionException- thrown in case a givenSequencecannot be processed.
-
receiveFrom
(Re-)initializes this instance by receiving the accordingSequencefrom the givenInputStream. Implementations providing error correction methods use the provided feedbackOutputStreamto do some sort of "stop-and-wait ARQ" or apply similar methods to ensure correctness of the received data.- Specified by:
receiveFromin interfaceSegment- Specified by:
receiveFromin interfaceSegment.SegmentMixin- Parameters:
aInputStream- TheInputStreamfrom which to read the instance's (re-)initializationSequencefrom.aReturnStream- AnOutputStreambeing the return channel to handle "stop-and-wait ARQ" or the like in case of a bidirectional connection. Can be null in case we have a unidirectional connection.- Throws:
IOException- thrown in case reading data from theInputStreamcaused problems.TransmissionException- thrown in case a given transmission cannot be processed.
-
toSchema
- Specified by:
toSchemain interfaceorg.refcodes.schema.Schemable- Specified by:
toSchemain interfaceTransmission- Specified by:
toSchemain interfaceTransmissionComposite<CHILD extends Segment>
-
hashCode
public int hashCode() -
equals
-
toString
- Overrides:
toStringin classAbstractTransmissionComposite<CHILD extends Segment>
-