📄 sessionresultfilter.html
字号:
<P><DD><DL><DT><B>Parameters:</B><DD><CODE>sortField</CODE> - the field that will be used for sorting.</DL></DD></DL><HR><A NAME="getSortOrder()"><!-- --></A><H3>getSortOrder</H3><PRE>public int <B>getSortOrder</B>()</PRE><DL><DD>Returns the sort order, which will be SessionResultFilter.ASCENDING for ascending sorting, or SessionResultFilter.DESCENDING for descending sorting. Descending sorting is: 3, 2, 1, etc. Ascending sorting is 1, 2, 3, etc.<P><DD><DL><DT><B>Returns:</B><DD>the sort order.</DL></DD></DL><HR><A NAME="setSortOrder(int)"><!-- --></A><H3>setSortOrder</H3><PRE>public void <B>setSortOrder</B>(int sortOrder)</PRE><DL><DD>Sets the sort type. Valid arguments are SessionResultFilter.ASCENDING for ascending sorting or SessionResultFilter.DESCENDING for descending sorting. Descending sorting is: 3, 2, 1, etc. Ascending sorting is 1, 2, 3, etc.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>sortOrder</CODE> - the order that results will be sorted in.</DL></DD></DL><HR><A NAME="getNumResults()"><!-- --></A><H3>getNumResults</H3><PRE>public int <B>getNumResults</B>()</PRE><DL><DD><p>Returns the max number of results that should be returned.</p> <p>The default value for is NO_RESULT_LIMIT, which means there will be no limit on the number of results. This method can be used in combination with setStartIndex(int) to perform pagination of results.</p><P><DD><DL><DT><B>Returns:</B><DD>the max number of results to return or NO_RESULT_LIMIT for no limit<DT><B>See Also:</B><DD><A HREF="../../../org/jivesoftware/openfire/SessionResultFilter.html#setStartIndex(int)"><CODE>setStartIndex(int)</CODE></A></DL></DD></DL><HR><A NAME="setNumResults(int)"><!-- --></A><H3>setNumResults</H3><PRE>public void <B>setNumResults</B>(int numResults)</PRE><DL><DD><p>Sets the limit on the number of results to be returned.</p> <p>User NO_RESULT_LIMIT if you don't want to limit the results returned.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>numResults</CODE> - the number of results to return or NO_RESULT_LIMIT for no limit</DL></DD></DL><HR><A NAME="getStartIndex()"><!-- --></A><H3>getStartIndex</H3><PRE>public int <B>getStartIndex</B>()</PRE><DL><DD>Returns the index of the first result to return.<P><DD><DL><DT><B>Returns:</B><DD>the index of the first result which should be returned.</DL></DD></DL><HR><A NAME="setStartIndex(int)"><!-- --></A><H3>setStartIndex</H3><PRE>public void <B>setStartIndex</B>(int startIndex)</PRE><DL><DD>Sets the index of the first result to return. For example, if the start index is set to 20, the Iterator returned will start at the 20th result in the query. This method can be used in combination with setNumResults(int) to perform pagination of results.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>startIndex</CODE> - the index of the first result to return.</DL></DD></DL><HR><A NAME="getSortComparator()"><!-- --></A><H3>getSortComparator</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html" title="class or interface in java.util">Comparator</A><<A HREF="../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</A>> <B>getSortComparator</B>()</PRE><DL><DD>Returns a comparator that will sort a standard sorted set according to this filter's sort order.<P><DD><DL><DT><B>Returns:</B><DD>a comparator that sorts Sessions matching the sort order for this filter.</DL></DD></DL><HR><A NAME="roundDate(java.util.Date, int)"><!-- --></A><H3>roundDate</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> <B>roundDate</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> date, int seconds)</PRE><DL><DD>Rounds the given date down to the nearest specified second. The following table shows sample input and expected output values: (Note, only the time portion of the date is shown for brevity) <p> <table border="1"> <tr><th>Date</th><th>Seconds</th><th>Result</th></tr> <tr><td>1:37.48</td><td>5</td><td>1:37.45</td></tr> <tr><td>1:37.48</td><td>10</td><td>1:37.40</td></tr> <tr><td>1:37.48</td><td>30</td><td>1:37.30</td</tr> <tr><td>1:37.48</td><td>60</td><td>1:37.00</td></tr> <tr><td>1:37.48</td><td>120</td><td>1:36.00</td></tr> </table><p> This method is useful when calculating the last post in a forum or the number of new messages from a given date. Using a rounded date allows Jive to internally cache the results of the date query. Here's an example that shows the last posted message in a forum accurate to the last 60 seconds:<p> <pre> SessionResultFilter filter = new SessionResultFilter(); filter.setSortOrder(SessionResultFilter.DESCENDING); filter.setSortField(JiveGlobals.SORT_CREATION_DATE); <b>filter.setCreationDateRangeMin(SessionResultFilter.roundDate(forum.getModificationDate(), 60));</b> filter.setNumResults(1); Iterator messages = forum.messages(filter); ForumMessage lastPost = (ForumMessage)messages.next(); </pre><P><DD><DL><DT><B>Parameters:</B><DD><CODE>date</CODE> - the <tt>Date</tt> we want to round.<DD><CODE>seconds</CODE> - the number of seconds we want to round the date to.<DT><B>Returns:</B><DD>the given date, rounded down to the nearest specified number of seconds.</DL></DD></DL><HR><A NAME="roundDate(long, int)"><!-- --></A><H3>roundDate</H3><PRE>public static long <B>roundDate</B>(long date, int seconds)</PRE><DL><DD>Rounds the given date down to the nearest specfied second.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>date</CODE> - the date (as a long) that we want to round.<DD><CODE>seconds</CODE> - the number of seconds we want to round the date to.<DT><B>Returns:</B><DD>the given date (as a long), rounded down to the nearest specified number of seconds.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/jivesoftware/openfire/SessionPacketRouter.html" title="class in org.jivesoftware.openfire"><B>PREV CLASS</B></A> <A HREF="../../../org/jivesoftware/openfire/SharedGroupException.html" title="class in org.jivesoftware.openfire"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/jivesoftware/openfire/SessionResultFilter.html" target="_top"><B>FRAMES</B></A> <A HREF="SessionResultFilter.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 2003-2008 Jive Software.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -