datetools.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 404 行 · 第 1/2 页
HTML
404 行
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="dateToString(java.util.Date, org.apache.lucene.document.DateTools.Resolution)"><!-- --></A><H3>
dateToString</H3>
<PRE>
public static <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>dateToString</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> date, <A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> resolution)</PRE>
<DL>
<DD>Converts a Date to a string suitable for indexing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>date</CODE> - the date to be converted<DD><CODE>resolution</CODE> - the desired resolution, see <A HREF="../../../../org/apache/lucene/document/DateTools.html#round(java.util.Date, org.apache.lucene.document.DateTools.Resolution)"><CODE>round(Date, DateTools.Resolution)</CODE></A><DT><B>Returns:</B><DD>a string in format <code>yyyyMMddHHmmssSSS</code> or shorter, depeding on <code>resolution</code>; using UTC as timezone</DL>
</DD>
</DL>
<HR>
<A NAME="timeToString(long, org.apache.lucene.document.DateTools.Resolution)"><!-- --></A><H3>
timeToString</H3>
<PRE>
public static <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>timeToString</B>(long time, <A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> resolution)</PRE>
<DL>
<DD>Converts a millisecond time to a string suitable for indexing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>time</CODE> - the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT<DD><CODE>resolution</CODE> - the desired resolution, see <A HREF="../../../../org/apache/lucene/document/DateTools.html#round(long, org.apache.lucene.document.DateTools.Resolution)"><CODE>round(long, DateTools.Resolution)</CODE></A><DT><B>Returns:</B><DD>a string in format <code>yyyyMMddHHmmssSSS</code> or shorter, depeding on <code>resolution</code>; using UTC as timezone</DL>
</DD>
</DL>
<HR>
<A NAME="stringToTime(java.lang.String)"><!-- --></A><H3>
stringToTime</H3>
<PRE>
public static long <B>stringToTime</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> dateString) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/text/ParseException.html" title="class or interface in java.text">ParseException</A></PRE>
<DL>
<DD>Converts a string produced by <code>timeToString</code> or <code>dateToString</code> back to a time, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateString</CODE> - the date string to be converted<DT><B>Returns:</B><DD>the number of milliseconds since January 1, 1970, 00:00:00 GMT<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/text/ParseException.html" title="class or interface in java.text">ParseException</A></CODE> - if <code>dateString</code> is not in the expected format</DL>
</DD>
</DL>
<HR>
<A NAME="stringToDate(java.lang.String)"><!-- --></A><H3>
stringToDate</H3>
<PRE>
public static <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> <B>stringToDate</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> dateString) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/text/ParseException.html" title="class or interface in java.text">ParseException</A></PRE>
<DL>
<DD>Converts a string produced by <code>timeToString</code> or <code>dateToString</code> back to a time, represented as a Date object.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateString</CODE> - the date string to be converted<DT><B>Returns:</B><DD>the parsed time as a Date object<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/text/ParseException.html" title="class or interface in java.text">ParseException</A></CODE> - if <code>dateString</code> is not in the expected format</DL>
</DD>
</DL>
<HR>
<A NAME="round(java.util.Date, org.apache.lucene.document.DateTools.Resolution)"><!-- --></A><H3>
round</H3>
<PRE>
public static <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> <B>round</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Date.html" title="class or interface in java.util">Date</A> date, <A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> resolution)</PRE>
<DL>
<DD>Limit a date's resolution. For example, the date <code>2004-09-21 13:50:11</code> will be changed to <code>2004-09-01 00:00:00</code> when using <code>Resolution.MONTH</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>resolution</CODE> - The desired resolution of the date to be returned<DT><B>Returns:</B><DD>the date with all values more precise than <code>resolution</code> set to 0 or 1</DL>
</DD>
</DL>
<HR>
<A NAME="round(long, org.apache.lucene.document.DateTools.Resolution)"><!-- --></A><H3>
round</H3>
<PRE>
public static long <B>round</B>(long time, <A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> resolution)</PRE>
<DL>
<DD>Limit a date's resolution. For example, the date <code>1095767411000</code> (which represents 2004-09-21 13:50:11) will be changed to <code>1093989600000</code> (2004-09-01 00:00:00) when using <code>Resolution.MONTH</code>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>resolution</CODE> - The desired resolution of the date to be returned<DT><B>Returns:</B><DD>the date with all values more precise than <code>resolution</code> set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT</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=3 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="class-use/DateTools.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/apache/lucene/document/DateField.html" title="class in org.apache.lucene.document"><B>PREV CLASS</B></A>
<A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="DateTools.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: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?