jahiasearchhit.java
来自「java 写的一个新闻发布系统」· Java 代码 · 共 70 行
JAVA
70 行
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .//// DJ 03.01.2001package org.jahia.data.search;import java.util.Comparator;import org.jahia.services.pages.JahiaPage;/** * This class defines what does a search "hit" looks like. * One hit is one page found by jahia containing at least one time the searchstring * in one of its fields. * * @see org.jahia.data.search.JahiaSearchResult * @see org.jahia.engines.search.Search_Engine * @author DJ */public class JahiaSearchHit implements Comparator { public int id; public Object obj; public int wordcount; /** * A small string coming from this page, usually containing one of the searched words. * Currently: one of the fields containing this word. */ public String teaser; /** Deprecated , use id instead */ public int pageID; /** Deprecated , use obj instead */ public JahiaPage page; //------------------------------------------------------------------------- /** * Compare between two objects, sort by their wordcount. * * @param Object * @param Object */ public int compare(Object c1, Object c2) throws ClassCastException { JahiaSearchHit hit1 = (JahiaSearchHit)c1; JahiaSearchHit hit2 = (JahiaSearchHit)c2; if ( hit2.wordcount > hit1.wordcount ){ return 1; } else if ( hit1.wordcount == hit2.wordcount ){ return 0; } return -1; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?