rtpi
Class RtpiData

java.lang.Object
  |
  +--rtpi.RtpiData
Direct Known Subclasses:
RtpiDeltaState, RtpiEvent, RtpiState, RtpiStateQuery

public abstract class RtpiData
extends java.lang.Object

This is the base class for RTPI ADUs. In order to put data into an ADU please use the getOutputStream method. After the data has been written from the returned output stream call the outputComplete method. In order to read data from an ADU please use the getInputStream method. The data can then be read from the input stream.

Author:
Martin Mauve

Method Summary
 java.io.ByteArrayInputStream getInputStream()
          This returns an input stream to this RtpiData object.
 java.io.OutputStream getOutputStream()
          This returns an output stream to this RtpiData object.
 int getParticipantID()
          This returns the participant ID of this ADU's sender.
 int getPayloadType()
          This returns the payload type of the ADU.
 int getPriority()
          This returns the priority of the ADU.
 byte getProfileInformation()
          This returns the profile specific information contained ADU.
 int getSequenceNumber()
          This gets the sequence number of the ADU.
 long getSubcomponentID()
          This returns the ID of the affected subcomponent.
 long getTimestamp()
          This returns the timestamp of the ADU.
 void outputComplete()
          This MUST be called when the output to the RtpiData object is finished.
 void setProfileInformation(byte pi)
          This sets the profile specific information for the ADU.
 void setRedundancy(float r)
          This sets the amount of redundancy for the transmission of the ADU.
 void setRedundancyTransmissionInterval(int t)
          This sets the interval during which redundancy information may be transmitted for this ADU.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setRedundancy

public void setRedundancy(float r)
This sets the amount of redundancy for the transmission of the ADU. The reliability service used must support this amount of reliability.
Parameters:
r - The amount of redundancy.

setRedundancyTransmissionInterval

public void setRedundancyTransmissionInterval(int t)
This sets the interval during which redundancy information may be transmitted for this ADU.

getPayloadType

public int getPayloadType()
This returns the payload type of the ADU.
Returns:
The payload type.

getPriority

public int getPriority()
This returns the priority of the ADU.
Returns:
The priority.

getProfileInformation

public byte getProfileInformation()
This returns the profile specific information contained ADU.
Returns:
The profile information.

setProfileInformation

public void setProfileInformation(byte pi)
This sets the profile specific information for the ADU.
Parameters:
pi - The profile specific information.

getParticipantID

public int getParticipantID()
This returns the participant ID of this ADU's sender.
Returns:
The sender's ID.

getSubcomponentID

public long getSubcomponentID()
This returns the ID of the affected subcomponent.
Returns:
The subcomponent ID.

getSequenceNumber

public int getSequenceNumber()
This gets the sequence number of the ADU.
Returns:
This ADU's sequence number.

getTimestamp

public long getTimestamp()
This returns the timestamp of the ADU.
Returns:
The timestamp.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
This returns an output stream to this RtpiData object. This stream should be used to put the data in the ADU. After finishing writing to the RtpiData object, outputComplete MUST be called on this object.
Returns:
The OutputStream.

outputComplete

public void outputComplete()
This MUST be called when the output to the RtpiData object is finished.

getInputStream

public java.io.ByteArrayInputStream getInputStream()
This returns an input stream to this RtpiData object. This stream should be used to read data from a received ADU.
Returns:
The InputStream.