edu.colorado.cs.ns2.animation
Class TraceEvent

java.lang.Object
  extended by edu.colorado.cs.ns2.animation.TraceEvent

public class TraceEvent
extends java.lang.Object

This class provides a structure to store the discrete events parsed from the NS2 trace file.

Author:
root Kevin Bauer, Pushkar Sambhoos.

Field Summary
private  double destinationAddress
          Stores the destination address.
private  java.lang.String event
          Stores the event type.
private  java.lang.String flags
          Stores any event flags.
private  int flowId
          Stores the flow identifier.
private  int fromNode
          Stores the source node.
private  int packetSize
          Stores the packet size.
private  java.lang.String packetType
          Stores the packet type.
private  int seqNo
          Stores the packet sequence number.
private  java.lang.String sName
          Stores the s name.
private  double sourceAddress
          Stores the source address.
private  double time
          Stores the event type.
private  int toNode
          Stores the destination node.
private  int uniqueId
          Stores the unique id for the current event.
 
Constructor Summary
TraceEvent()
          Default constructor.
TraceEvent(java.lang.String event, double time, int fromNode, int toNode, java.lang.String packetType, int packetSize, java.lang.String flags, int flowId, int uniqueId, double sourceAddress, double destinationAddress, int seqNo, java.lang.String sName)
          This constructor populates every field defined in the TraceEvent class.
 
Method Summary
 double getDestinationAddress()
          Get the address of the Destination Node.
 java.lang.String getEvent()
          Get the Event Type as "h", "+", "-" or "r"
 java.lang.String getFlags()
          Get the flags set on the Packet.
 int getFlowId()
          Get the Flow ID.
 int getFromNode()
          Get the Source Node of the Packet.
 int getPacketSize()
          Get the Packet Size
 java.lang.String getPacketType()
          Get the Packet Type
 int getSeqNo()
          Get the Sequence Number
 java.lang.String getSName()
          Get S-Name - Do not know what Sname is??
 double getSourceAddress()
          Get Source Node Address
 double getTime()
          Get the Time of the Event.
 int getToNode()
          Get the Destination Node Id
 int getUniqueId()
          Get the Unique Id of the Packet.
 void setDestinationAddress(double destinationAddress)
          Set the address of the Destination Node.
 void setEvent(java.lang.String event)
          Set the Event Type as "h", "+", "-" or "r"
 void setFlags(java.lang.String flags)
          Set the flags set on the Packet.
 void setFlowId(int flowId)
          Set the Flow ID.
 void setFromNode(int fromNode)
          Set the Source Node of the Packet.
 void setPacketSize(int packetSize)
          Set the Packet Size
 void setPacketType(java.lang.String packetType)
          Set the Packet Type
 void setSeqNo(int seqNo)
          Set the Sequence Number
 void setSName(java.lang.String name)
          Set S-Name - Do not know what Sname is??
 void setSourceAddress(double sourceAddress)
          Set Source Node Address
 void setTime(double time)
          Set the Time of the Event.
 void setToNode(int toNode)
          Set the Destination Node Id
 void setUniqueId(int uniqueId)
          Set the Unique Id of the Packet.
 java.lang.String toString()
          Returns a String representation of a TraceEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

event

private java.lang.String event
Stores the event type.


time

private double time
Stores the event type.


fromNode

private int fromNode
Stores the source node.


toNode

private int toNode
Stores the destination node.


packetType

private java.lang.String packetType
Stores the packet type.


packetSize

private int packetSize
Stores the packet size.


flags

private java.lang.String flags
Stores any event flags.


flowId

private int flowId
Stores the flow identifier.


uniqueId

private int uniqueId
Stores the unique id for the current event.


sourceAddress

private double sourceAddress
Stores the source address.


destinationAddress

private double destinationAddress
Stores the destination address.


seqNo

private int seqNo
Stores the packet sequence number.


sName

private java.lang.String sName
Stores the s name.

Constructor Detail

TraceEvent

public TraceEvent()
Default constructor.


TraceEvent

public TraceEvent(java.lang.String event,
                  double time,
                  int fromNode,
                  int toNode,
                  java.lang.String packetType,
                  int packetSize,
                  java.lang.String flags,
                  int flowId,
                  int uniqueId,
                  double sourceAddress,
                  double destinationAddress,
                  int seqNo,
                  java.lang.String sName)
This constructor populates every field defined in the TraceEvent class.

Parameters:
event - The event type.
time - The event time.
fromNode - The source node.
toNode - The destination node.
packetType - The packet type.
packetSize - The packet size.
flags - The event flags.
flowId - The flow identifier.
uniqueId - The event's unique identifier.
sourceAddress - The source address.
destinationAddress - The destination address.
seqNo - The sequence number.
sName - The s name.
Method Detail

getDestinationAddress

public double getDestinationAddress()
Get the address of the Destination Node.

Returns:
- Destination Address

setDestinationAddress

public void setDestinationAddress(double destinationAddress)
Set the address of the Destination Node.

Parameters:
destinationAddress -

getEvent

public java.lang.String getEvent()
Get the Event Type as "h", "+", "-" or "r"

Returns:
- Event Type

setEvent

public void setEvent(java.lang.String event)
Set the Event Type as "h", "+", "-" or "r"

Parameters:
Event - type

getFlags

public java.lang.String getFlags()
Get the flags set on the Packet.

Returns:
- flags

setFlags

public void setFlags(java.lang.String flags)
Set the flags set on the Packet.

Parameters:
flags -

getFlowId

public int getFlowId()
Get the Flow ID.

Returns:
flowID

setFlowId

public void setFlowId(int flowId)
Set the Flow ID.

Parameters:
flowId -

getUniqueId

public int getUniqueId()
Get the Unique Id of the Packet.

Returns:
- Unique ID

setUniqueId

public void setUniqueId(int uniqueId)
Set the Unique Id of the Packet.

Parameters:
uniqueId -

getFromNode

public int getFromNode()
Get the Source Node of the Packet.

Returns:
Souce Node Id.

setFromNode

public void setFromNode(int fromNode)
Set the Source Node of the Packet.

Parameters:
Source - Node Id

getPacketSize

public int getPacketSize()
Get the Packet Size

Returns:
Packet Size

setPacketSize

public void setPacketSize(int packetSize)
Set the Packet Size

Parameters:
packetSize -

getPacketType

public java.lang.String getPacketType()
Get the Packet Type

Returns:
Packet Type

setPacketType

public void setPacketType(java.lang.String packetType)
Set the Packet Type

Parameters:
packetType -

getSeqNo

public int getSeqNo()
Get the Sequence Number

Returns:
sequence number

setSeqNo

public void setSeqNo(int seqNo)
Set the Sequence Number

Parameters:
sequence - number

getSourceAddress

public double getSourceAddress()
Get Source Node Address

Returns:
Source Address

setSourceAddress

public void setSourceAddress(double sourceAddress)
Set Source Node Address

Parameters:
Source - Address

getTime

public double getTime()
Get the Time of the Event.

Returns:
- Time

setTime

public void setTime(double time)
Set the Time of the Event.

Parameters:
Time -

getToNode

public int getToNode()
Get the Destination Node Id

Returns:
- Node Id

setToNode

public void setToNode(int toNode)
Set the Destination Node Id

Parameters:
Node - Id

getSName

public java.lang.String getSName()
Get S-Name - Do not know what Sname is??

Returns:
S-Name

setSName

public void setSName(java.lang.String name)
Set S-Name - Do not know what Sname is??

Parameters:
S-Name -

toString

public java.lang.String toString()
Returns a String representation of a TraceEvent.

Overrides:
toString in class java.lang.Object
Returns:
A String representation of a TraceEvent.