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

📄 index.java

📁 java实现的全文搜索引擎
💻 JAVA
字号:
/**
 * 
 */
package cn.edu.nju.software.ruse;

import java.io.File;
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.HashSet;

/**
 * @author spring
 *
 */
public class Index implements Serializable {

	/**
	 * Hold the index about modTime
	 */
	private HashMap<String, HashSet<File>> modTimeIndex = new HashMap<String, HashSet<File>>();
	
	/**
	 * Hold the index about fileSize
	 */
	private HashMap<Long, HashSet<File>> fileSizeIndex = new HashMap<Long, HashSet<File>>();
	
	/**
	 * Hold the index about fileName
	 */
	private File[] fileNameIndex;
	
	/**
	 * Hold the index about fileContents, where HashMap indicates every word's
	 * position in each file.
	 */
	private HashMap<String, HashMap<File,HashSet<Integer>>> fileContentsIndex = new HashMap<String, HashMap<File,HashSet<Integer>>>();

	public HashMap<String, HashSet<File>> getModTimeIndex() {
		return modTimeIndex;
	}

	public void setModTimeIndex(HashMap<String, HashSet<File>> modTimeIndex) {
		this.modTimeIndex = modTimeIndex;
	}

	public HashMap<Long, HashSet<File>> getFileSizeIndex() {
		return fileSizeIndex;
	}

	public void setFileSizeIndex(HashMap<Long, HashSet<File>> fileSizeIndex) {
		this.fileSizeIndex = fileSizeIndex;
	}

	public HashMap<String, HashMap<File, HashSet<Integer>>> getFileContentsIndex() {
		return fileContentsIndex;
	}

	public void setFileContentsIndex(
			HashMap<String, HashMap<File, HashSet<Integer>>> fileContentsIndex) {
		this.fileContentsIndex = fileContentsIndex;
	}

	public File[] getFileNameIndex() {
		return fileNameIndex;
	}

	public void setFileNameIndex(File[] fileNameIndex) {
		this.fileNameIndex = fileNameIndex;
	}
	
	
}

⌨️ 快捷键说明

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