⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.java

📁 一个简单的学生管理软件。。。是计算机系学生的一次web课的project
💻 JAVA
字号:
package fy;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;




public class test {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static final int RR=0;
	public static final int L=1;
	static int firstsearchMode=test.L;
	static int secondsearchMode=test.L;
	static Graph graph ;
	static String firstStringNode;
	static String secondStringNode;
	public static void main(String[] args) throws IOException {
		if(args.length!=1){
			printStr("Usage:exeName inputfilename!!");
			System.exit(1);
		}
		String filename=args[0];
		
		printStr("******************map catcher********************\n");
		printStr("load file :"+filename+"------");
		graph =  new Graph(filename);
		printStr("load file :"+filename+"  complete!");
		welcome();
		BufferedReader buf;
	    String str;
	    int option;
	    buf=new BufferedReader (new InputStreamReader(System.in));
	    System.out.print("input ur option>");
		while(true){
			option = Integer.parseInt(buf.readLine());
			switch(option){
				case 1:
					System.out.print("input ur new filename to load>");
					String newfilename=buf.readLine();
					graph = new Graph(newfilename);
					break;
				case 2:
					System.exit(0);
				case 3:
					printStr("usage:");
					printStr(">>>>>>>>>roadName1*roadName2 to roadName3*roadName4");
					printStr(">>>>>>>>>roadName1*roadName2 to landmark1");
					printStr(">>>>>>>>>landmark1 to roadName1*roadName2 ");
					printStr(">>>>>>>>>landmark1 to landmark2");
					printStr("please input your search string with the right format:");
					prase(buf.readLine());
					graph.search(firstStringNode,secondStringNode,firstsearchMode,secondsearchMode);
					break;
				default:
					printStr("unknown option!");
					break;
			}
		}
	}	
	private static void prase(String string) {
		StringTokenizer tokens = new StringTokenizer(string);
		if(tokens.countTokens()!=3){
			return ;
		}
		String firstString = tokens.nextToken();
		tokens.nextToken();
		String secondString = tokens.nextToken();
		if(firstString.indexOf("*")>0){
			firstStringNode=firstString.replace('*', '2');
			firstsearchMode=test.RR;
		}
		if(secondString.indexOf("*")>0){
			secondStringNode=secondString.replace('*', '2');
			secondsearchMode =test.RR;
		}
	}
	private static void printStr(String str){
		System.out.print(str+"\n");
	}
	private static void welcome(){
		printStr("choose ur options with 1 or 2 or 3---:");
		printStr(">>>>>>>>>option 1 : load other file");
		printStr(">>>>>>>>>option 2 : exit");
		printStr(">>>>>>>>>option 3 : search");
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -