Sim
Class HardwareFrame

java.lang.Object
  extended by Sim.HardwareFrame

public class HardwareFrame
extends java.lang.Object

HardwareFrame represents a physical layer data transfer from one neighbor to the next.


Field Summary
static int BROADCAST
          Broadcast address.
 
Constructor Summary
HardwareFrame(int source, int dest, ProtocolFrame protocolData, Packet userData)
          Constructs a new HardwareFrame that will be broadcast from the node with "sourceId" and is meant for neighbor with "destId".
 
Method Summary
 int getDest()
           
 ProtocolFrame getProtocolData()
           
 int getSize()
           
 int getSizeInBits()
          Returns getSize() * 8.
 int getSource()
           
 Packet getUserData()
           
 boolean isBroadcast()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BROADCAST

public static final int BROADCAST
Broadcast address.

See Also:
Constant Field Values
Constructor Detail

HardwareFrame

public HardwareFrame(int source,
                     int dest,
                     ProtocolFrame protocolData,
                     Packet userData)
Constructs a new HardwareFrame that will be broadcast from the node with "sourceId" and is meant for neighbor with "destId". The HardwareFrame contains the given data Packet.

Parameters:
source - sending node
dest - destination neighbor, or BROADCAST if broadcast
protocolData - non-null routing protocol section of frame
userData - nullable user packet data, if any attached
Method Detail

isBroadcast

public boolean isBroadcast()

getSize

public int getSize()

getSizeInBits

public int getSizeInBits()
Returns getSize() * 8.


getSource

public int getSource()

getDest

public int getDest()

getProtocolData

public ProtocolFrame getProtocolData()

getUserData

public Packet getUserData()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object