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

📄 collectionwrapper.java

📁 一个美国教授写得很好的java学生管理系统
💻 JAVA
字号:
// CollectionWrapper.java - Chapter 16 version.

// Copyright 2000 by Jacquie Barker - all rights reserved.

// An IMPLEMENTATION class.
package DataInterface;

import java.io.*;

public abstract class CollectionWrapper {
	private String pathToFile;

	public boolean initializeObjects(String pathToFile, boolean primary) {
		this.pathToFile = pathToFile;
		String line = null;
		BufferedReader bIn = null;
		boolean outcome = true;

		try {
			// Open the file. 
			bIn = new BufferedReader(new FileReader(pathToFile));

		    	line = bIn.readLine();
		    	while (line != null) {
			        if (primary) parseData(line);
			        else parseData2(line);
		    		line = bIn.readLine();
			}

			bIn.close();
		}
		catch (FileNotFoundException f) {
			outcome = false;
		}
		catch (IOException i) {
			outcome = false;
		}

		return outcome;
	}

	public abstract void parseData(String line);
	public abstract void parseData2(String line);
}

⌨️ 快捷键说明

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