📄 networkpackage.java
字号:
package dk.itu.nulx30.networkModel;
import java.util.ArrayList;
import dk.itu.nulx30.networkModel.exceptions.PackageTTLException;
/**
* This interface specifies the packages transferred in the network model.
*
* @author Jacob Wahl Winther
* @author Mikkel Bundgaard
* @author Troels C. Damgaard
* @author Federico Decara
*/
public interface NetworkPackage{
/**
* Should append the wire and the router to the pathList. A <code>
* PackageTTLException</code> should be thrown if a package has
* exceeded its TTL limit.
*
* @param w the wire which to add to the pathlist
* @param r Router to add to pathList
*
* @exception PackageTTLException a <code>PackageTTLException</code> is
* thrown if a package has exceeded its TTL limit.
*
* @see dk.itu.nulx30.networkModel.exceptions.PackageTTLException
*/
public void addRouterToPathList( Wire w, Router r ) throws PackageTTLException;
/**
* Should return the path list for the package
*
* @return the path list for this object
*/
public ArrayList getPathList();
/**
* Should return the source Router for this package
*
* @return the source Router for this package
*/
public Router getSource();
/**
* Should return the destination Router for this package
*
* @return the destination Router for this package
*/
public Router getDestination();
/**
* Should update the time of this package to <code>newTime</code>.
*
* @param newTime the new time of this object
*/
public void setTime( double newTime );
/**
* Should return the time of this package
*
* @return the time of this package
*/
public double getTime();
/**
* Get the difference between creation time and current time for package
*
* @return the time this package has spent in the network
*/
public double getTimeInNetwork();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -