?? map.java
字號(hào):
import java.io.*;
public class Map
{
private Mistake me;
AWD Path;
int numbers;
String []place;
// used for absent edge
public Map()
{
numbers=10;
place=new String[numbers];
for(int i=0;i<=5;i++)
{
place[i]=new String();
}
place[1]="a";
place[2]="b";
place[3]="c";
place[4]="d";
place[5]="e";
Path=new AWD (10,100000000);
Path.Add(1, 2, 1);
Path.Add(2, 3, 1);
Path.Add(1, 3, 4);
Path.Add(1, 5, 1);
Path.Add(2, 5, 2);
}
public Map(int n)
{
numbers=n;
try
{
BufferedReader inputStream=new BufferedReader(new FileReader("E:\\workspace6.0\\place.txt"));
String line=null;
line=inputStream.readLine();
int m=line.indexOf("-");
inputStream.close();
}
catch(FileNotFoundException e)
{
me=new Mistake("文件不存在!");
}
catch(IOException e)
{
me=new Mistake("文件內(nèi)容讀取錯(cuò)誤!");
}
}
public int Search(int s,int t,int []d,int []p)
{
for(int i=0;i<=numbers;i++)p[i]=0;
Path.SortPath(s,t,d,p);
return Path.SortPath(s,t,d,p);
}
public String getname(int n)
{
return place[n];
}
public int getnumber(String name)
{
int n=0;
while(!(place[n].equals(name)))
n++;
return n;
}
public int getamount()
{
return numbers;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -