nodeinterface.java
来自「用JAVA实现的一种DIJ算法过程」· Java 代码 · 共 36 行
JAVA
36 行
// 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 + =
减小字号Ctrl + -
显示快捷键?