📄 jahiasearchresult.java
字号:
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .//// DJ 03.01.2001// NK 06.05.2002 Added BitSet and accessors addHit(), results(), getHitCount(), bits()////package org.jahia.data.search;import java.util.*; // Vectorimport org.jahia.services.pages.JahiaPage;import org.jahia.data.search.*; // JahiaSearchHit/** * An instance of this class is returned by the SearchEngine (and the corresponding search * service). It contains a vector of JahiaSearchHit and a hit counter. * * @see org.jahia.engines.search.Search_Engine * @author DJ * @author NK */public class JahiaSearchResult{ /** * Vector of JahiaSearchHit */ private Vector results = new Vector(); // vector of JahiaSearchHit /** * The BitSet of matching ids */ private BitSet bits = new BitSet(); // vector of matching ids as bits /** * number of hits */ private int hitcount ; //-------------------------------------------------------------------------- /** * Add a hit and use the hit's id to set the corresponding bit in the BitSet to true. * Increment the hitcount counter. * * @param JahiaSearchHit a hit */ public void addHit(JahiaSearchHit hit ){ if ( hit == null ) return; results.add(hit); bits.set(((JahiaSearchHit)hit).id); hitcount++; } //-------------------------------------------------------------------------- /** * Returns the results. * * @return Vector results, the results. */ public Vector results(){ return results; } //-------------------------------------------------------------------------- /** * Returns the BitSet of matching ids. * * @return BitSet the bit set. */ public BitSet bits(){ return bits; } //-------------------------------------------------------------------------- /** * Returns the number of hits * * @return int hitcount, the umber of hits. */ public int getHitCount(){ return hitcount; } //-------------------------------------------------------------------------- // // Deprecated // // /** * Vector of JahiaSearchHit * Deprecated , use results instead. * * @Deprecated */ public Vector pages = new Vector(); // vector of JahiaSearchHit /** * Deprecated , use hitcount instead. * number of hits */ public int pagecount = 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -