test.java

来自「利用hibernate框架进行开发的全景浏览与导航系统。」· Java 代码 · 共 63 行

JAVA
63
字号
package com.shandong.test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.LinkedList;
import java.util.List;

import com.shandong.business.iface.HotspotAdminService;
import com.shandong.business.imp.HotspotAdminServiceImp;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		method1();
	}

	public static void method1() {
		try {
			HotspotAdminService service = new HotspotAdminServiceImp();
			BufferedReader fr = new BufferedReader(new FileReader(
					"C:\\Floor 4.txt"));
			String line = fr.readLine();
			while (line != null && !line.equals("")) {
				if (line.substring(0, 1).equals(";")) {
					line = fr.readLine();
					continue;
				}
				int i = line.indexOf(" ");
				if (i == -1) {
					line = fr.readLine();
					continue;
				}
				String name = line.substring(0, i);
				String info = line.substring(i + 1);

				System.out.println(name + ", " + info);
				service.insertHotspot(name, info);
				line = fr.readLine();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void method2() {
		try {
			List l = new LinkedList();
			l.add("a");
			l.add("b");
			l.add("p");
			l.add("q");
			HotspotAdminService service = new HotspotAdminServiceImp();
			service.exportHotspot(l, "c:\\Floor 1.txt");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

⌨️ 快捷键说明

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