📄 nodeinterface.java
字号:
// NodeInterface.java// CNA, S2, 2008// v 0.1, 02 July 2008 - Nick Falknerpublic interface NodeInterface extends Comparable<NetworkNode> { // You will, of course, also need to add constructors and any other // methods that you consider useful. // Need a way to associate links with this node. // Note: there will be a corresponding way to access links but this // is left to your discretion. public void addLink(NetworkLink newLink); // We represent D(v) as a distance stored in the node. // Providing we use the same u, this is valid. public void setDistance(double newDistance); public double getDistance(); // This keeps track of the node that is immediately previous to us // on the path back to the source node. public void setPreviousNode(NetworkNode newPrev); public NetworkNode getPreviousNode(); // Required by Comparable. // (A number of handy Java data structures use Comparable) public int compareTo(NetworkNode o);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -