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

📄 retrieval.java

📁 一个使用的搜索引擎
💻 JAVA
字号:
package ir.vsr;/** A lightweight object for storing information about a retrieved Document. * * @author Ray Mooney */public class Retrieval implements java.lang.Comparable {    /** A reference to the Document being retrieved */    public DocumentReference docRef;    /** The score given to this document by a retrieval engine. Higher scores     * mean it is more relevant to the query */    public double score;    /** Create a retrieval with these values */    public Retrieval (DocumentReference docRef, double score) {	this.docRef = docRef;	this.score = score;    }    /** Compares this Retrieval to another for sorting from best to worst.     *	@param obj The Retrieval to compare with.     *  @return -1 if better than obj, 0 if same, 1 if worse than obj     * since this will produce a descending sort from best to worst.     * @see Arrays.sort     */    public int compareTo(Object obj) {	Retrieval retrieval = (Retrieval)obj;	if (score == retrieval.score) 	    return 0;	else if (score > retrieval.score) 	    return -1;	else return 1;    }		}

⌨️ 快捷键说明

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