📄 listedges.java
字号:
/*
* ListEdges.java
*
* Created on May 29, 2007, 11:00 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package termproject_dijkstra;
public class ListEdges
{
ListEdgesElement head;
ListEdgesElement travPointer; // For traversing list
/** Creates a new instance of ListEdges */
public ListEdges()
{
head = null;
// tail = null;
travPointer = null;
}
public void PushByWeight(Node node, int iWeight)
{
// Our first time :)
if (head==null)
{
head = new ListEdgesElement(node,iWeight);
}
else
head.PushByWeight(node,iWeight);
}
public void InitTraversing()
{
travPointer = head;
}
public ListEdgesElement GetAndMove()
{
ListEdgesElement retVal;
if (travPointer != null)
{
retVal = travPointer;
travPointer = travPointer.next;
}
else
retVal = null;
return retVal;
}
public void ClearList()
{
head = null;
}
public boolean IsEmpty()
{
return (head == null);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -