GridSim 5.0 beta

gridsim.net.fnb
Class GridletPackets

Object
  extended by GridletPackets

public class GridletPackets
extends Object

This class contains relevant information of a dropped Gridlet or File object. Since a gridlet or a file is broken into many packets according to the Maximum Transmission Unit (MTU), this class records the first packet ID, the last packet ID, and the Gridlet or File ID. This class is mainly used by the FnbInput and FnbOutput classes.

For example, a gridlet with id = 3 is made of 20 packets, e.g. from packet id 2 to 21. Then, this class stores the following information: the first packet number is 2, the last packet number is 21, the ID is 3, and isFile() returns false.

Since:
5.0
Author:
Agustin Caminero and Anthony Sulistio
See Also:
Link.DEFAULT_MTU, Gridlet, File

Constructor Summary
GridletPackets()
           
 
Method Summary
 void firstLastPacketsGridlet(int firstPacketID, int lastPacketID)
          Creates a new object of this class.
 int getFirstPacketID()
          Gets the id of the first packet.
 int getID()
          Gets a file or gridlet ID.
NOTE: If isFile() denotes true, then it is a file ID, false otherwise
 int getLastPacketID()
          Gets the id of the last packet.
 boolean isFile()
          Determines whether this class stores a file ID or a gridlet ID
 void setFileID(int fileID)
          Sets the file id.
 void setFirstPacketID(int firstID)
          Sets the id of the first packet.
 void setGridletID(int gridletID)
          Sets the gridlet id.
 void setLastPacketID(int lastID)
          Sets the id of the last packet.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridletPackets

public GridletPackets()
Method Detail

firstLastPacketsGridlet

public void firstLastPacketsGridlet(int firstPacketID,
                                    int lastPacketID)
Creates a new object of this class.

Parameters:
firstPacketID - the first packet id
lastPacketID - the last packet id

isFile

public boolean isFile()
Determines whether this class stores a file ID or a gridlet ID

Returns:
true this class stores a file ID, false otherwise

getFirstPacketID

public int getFirstPacketID()
Gets the id of the first packet.

Returns:
the id of the first packet

getLastPacketID

public int getLastPacketID()
Gets the id of the last packet.

Returns:
the id of the last packet

setLastPacketID

public void setLastPacketID(int lastID)
Sets the id of the last packet.

Parameters:
lastID - the id of the last packet.

setFirstPacketID

public void setFirstPacketID(int firstID)
Sets the id of the first packet.

Parameters:
firstID - the id of the first packet.

setGridletID

public void setGridletID(int gridletID)
Sets the gridlet id.

Parameters:
gridletID - the gridlet id

setFileID

public void setFileID(int fileID)
Sets the file id.

Parameters:
fileID - the file id

getID

public int getID()
Gets a file or gridlet ID.
NOTE: If isFile() denotes true, then it is a file ID, false otherwise

Returns:
a file or gridlet ID.

GridSim 5.0 beta

The University of Melbourne, Australia, 2009