You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.2 KiB
Java
56 lines
1.2 KiB
Java
// MUXSdu.java
|
|
|
|
package protocol; // protocol package
|
|
|
|
import support.*; // import Jasper support classes
|
|
|
|
/**
|
|
This is the class that defines (de)multiplexer service messages.
|
|
|
|
@author Kenneth J. Turner
|
|
@version 1.0 (20th July 2010, KJT): initial version
|
|
*/
|
|
|
|
public class MUXSdu extends PDU {
|
|
|
|
/** Service SDU type */
|
|
public final static String TYPE = "DATA";
|
|
|
|
/** Service entity */
|
|
public int entity;
|
|
|
|
/** Service message */
|
|
public String sdu;
|
|
|
|
/**
|
|
Constructor for a source/sink service message.
|
|
|
|
@param entity service entity index
|
|
@param sdu SDU data
|
|
*/
|
|
public MUXSdu(int entity, String sdu) {
|
|
super(TYPE); // construct with type
|
|
this.entity = entity; // set entity index
|
|
this.sdu = sdu; // set SDU data
|
|
}
|
|
|
|
/**
|
|
Return the label for an arrow representing a (de)multiplexer SDU in a time
|
|
sequence diagram.
|
|
|
|
@return the label name
|
|
*/
|
|
public String getLabel() {
|
|
return(type + "(" + entity + "," + sdu + ")");
|
|
}
|
|
|
|
/**
|
|
Convert SDU to string.
|
|
*/
|
|
public String toString() {
|
|
return("SDU <Type " + type + ", Entity " + entity + ", Data " + sdu + ">");
|
|
}
|
|
|
|
}
|
|
|