📄 distvertex.java
字号:
/* DistVertex.java
* ---------------------------------------------
* Copyright (c) 2001 University of Saskatchewan
* All Rights Reserved
* --------------------------------------------- */
import dslib.graph.SearchVertexUos;
/** A searchable vertex with a distance field. */
public class DistVertex extends SearchVertexUos
{
/** The distance for the vertex. */
protected int dist;
/** Construct a new vertex, store n and id as the vertex's name and index. <br>
Analysis: Time = O(1)
@param n name of the new vertex
@param id index of the new vertex */
public DistVertex (String n, int id)
{
super(n, id);
}
/** The distance for the vertex. <br>
Analysis: Time = O(1) */
public int dist()
{
return dist;
}
/** Set the distance for this vertex. <br>
Analysis: Time = O(1) */
public void setDist(int newDist)
{
dist = newDist;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -