1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
---|
2 | <!--NewPage--> |
---|
3 | <HTML> |
---|
4 | <HEAD> |
---|
5 | <!-- Generated by javadoc (build 1.6.0_24) on Mon Jun 25 15:26:26 EDT 2012 --> |
---|
6 | <META http-equiv="Content-Type" content="text/html; charset=utf-8"> |
---|
7 | <TITLE> |
---|
8 | DateMathParser (Solr 4.0.0-ALPHA API) |
---|
9 | </TITLE> |
---|
10 | |
---|
11 | <META NAME="date" CONTENT="2012-06-25"> |
---|
12 | |
---|
13 | <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
---|
14 | |
---|
15 | <SCRIPT type="text/javascript"> |
---|
16 | function windowTitle() |
---|
17 | { |
---|
18 | if (location.href.indexOf('is-external=true') == -1) { |
---|
19 | parent.document.title="DateMathParser (Solr 4.0.0-ALPHA API)"; |
---|
20 | } |
---|
21 | } |
---|
22 | </SCRIPT> |
---|
23 | <NOSCRIPT> |
---|
24 | </NOSCRIPT> |
---|
25 | |
---|
26 | </HEAD> |
---|
27 | |
---|
28 | <BODY BGCOLOR="white" onload="windowTitle();"> |
---|
29 | <HR> |
---|
30 | |
---|
31 | |
---|
32 | <!-- ========= START OF TOP NAVBAR ======= --> |
---|
33 | <A NAME="navbar_top"><!-- --></A> |
---|
34 | <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
---|
35 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
36 | <TR> |
---|
37 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
38 | <A NAME="navbar_top_firstrow"><!-- --></A> |
---|
39 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
40 | <TR ALIGN="center" VALIGN="top"> |
---|
41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
42 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
43 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
44 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DateMathParser.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
45 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
46 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
47 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
48 | </TR> |
---|
49 | </TABLE> |
---|
50 | </TD> |
---|
51 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
52 | </EM> |
---|
53 | </TD> |
---|
54 | </TR> |
---|
55 | |
---|
56 | <TR> |
---|
57 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
58 | <A HREF="../../../../org/apache/solr/util/ConcurrentLRUCache.Stats.html" title="class in org.apache.solr.util"><B>PREV CLASS</B></A> |
---|
59 | <A HREF="../../../../org/apache/solr/util/DefaultSolrThreadFactory.html" title="class in org.apache.solr.util"><B>NEXT CLASS</B></A></FONT></TD> |
---|
60 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
61 | <A HREF="../../../../index.html?org/apache/solr/util/DateMathParser.html" target="_top"><B>FRAMES</B></A> |
---|
62 | <A HREF="DateMathParser.html" target="_top"><B>NO FRAMES</B></A> |
---|
63 | <SCRIPT type="text/javascript"> |
---|
64 | <!-- |
---|
65 | if(window==top) { |
---|
66 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
67 | } |
---|
68 | //--> |
---|
69 | </SCRIPT> |
---|
70 | <NOSCRIPT> |
---|
71 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
72 | </NOSCRIPT> |
---|
73 | |
---|
74 | |
---|
75 | </FONT></TD> |
---|
76 | </TR> |
---|
77 | <TR> |
---|
78 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
79 | SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
81 | DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
82 | </TR> |
---|
83 | </TABLE> |
---|
84 | <A NAME="skip-navbar_top"></A> |
---|
85 | <!-- ========= END OF TOP NAVBAR ========= --> |
---|
86 | |
---|
87 | <HR> |
---|
88 | <!-- ======== START OF CLASS DATA ======== --> |
---|
89 | <H2> |
---|
90 | <FONT SIZE="-1"> |
---|
91 | org.apache.solr.util</FONT> |
---|
92 | <BR> |
---|
93 | Class DateMathParser</H2> |
---|
94 | <PRE> |
---|
95 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> |
---|
96 | <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.solr.util.DateMathParser</B> |
---|
97 | </PRE> |
---|
98 | <HR> |
---|
99 | <DL> |
---|
100 | <DT><PRE>public class <B>DateMathParser</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> |
---|
101 | </PRE> |
---|
102 | |
---|
103 | <P> |
---|
104 | A Simple Utility class for parsing "math" like strings relating to Dates. |
---|
105 | |
---|
106 | <p> |
---|
107 | The basic syntax support addition, subtraction and rounding at various |
---|
108 | levels of granularity (or "units"). Commands can be chained together |
---|
109 | and are parsed from left to right. '+' and '-' denote addition and |
---|
110 | subtraction, while '/' denotes "round". Round requires only a unit, while |
---|
111 | addition/subtraction require an integer value and a unit. |
---|
112 | Command strings must not include white space, but the "No-Op" command |
---|
113 | (empty string) is allowed.... |
---|
114 | </p> |
---|
115 | |
---|
116 | <pre> |
---|
117 | /HOUR |
---|
118 | ... Round to the start of the current hour |
---|
119 | /DAY |
---|
120 | ... Round to the start of the current day |
---|
121 | +2YEARS |
---|
122 | ... Exactly two years in the future from now |
---|
123 | -1DAY |
---|
124 | ... Exactly 1 day prior to now |
---|
125 | /DAY+6MONTHS+3DAYS |
---|
126 | ... 6 months and 3 days in the future from the start of |
---|
127 | the current day |
---|
128 | +6MONTHS+3DAYS/DAY |
---|
129 | ... 6 months and 3 days in the future from now, rounded |
---|
130 | down to nearest day |
---|
131 | </pre> |
---|
132 | |
---|
133 | <p> |
---|
134 | All commands are relative to a "now" which is fixed in an instance of |
---|
135 | DateMathParser such that |
---|
136 | <code>p.parseMath("+0MILLISECOND").equals(p.parseMath("+0MILLISECOND"))</code> |
---|
137 | no matter how many wall clock milliseconds elapse between the two |
---|
138 | distinct calls to parse (Assuming no other thread calls |
---|
139 | "<code>setNow</code>" in the interim) |
---|
140 | </p> |
---|
141 | |
---|
142 | <p> |
---|
143 | Multiple aliases exist for the various units of time (ie: |
---|
144 | <code>MINUTE</code> and <code>MINUTES</code>; <code>MILLI</code>, |
---|
145 | <code>MILLIS</code>, <code>MILLISECOND</code>, and |
---|
146 | <code>MILLISECONDS</code>.) The complete list can be found by |
---|
147 | inspecting the keySet of <code>CALENDAR_UNITS</code>. |
---|
148 | </p> |
---|
149 | <P> |
---|
150 | |
---|
151 | <P> |
---|
152 | <HR> |
---|
153 | |
---|
154 | <P> |
---|
155 | <!-- =========== FIELD SUMMARY =========== --> |
---|
156 | |
---|
157 | <A NAME="field_summary"><!-- --></A> |
---|
158 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
159 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
160 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
161 | <B>Field Summary</B></FONT></TH> |
---|
162 | </TR> |
---|
163 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
164 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
165 | <CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>></CODE></FONT></TD> |
---|
166 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#CALENDAR_UNITS">CALENDAR_UNITS</A></B></CODE> |
---|
167 | |
---|
168 | <BR> |
---|
169 | A mapping from (uppercased) String labels idenyifying time units, |
---|
170 | to the corresponding Calendar constant used to set/add/roll that unit |
---|
171 | of measurement.</TD> |
---|
172 | </TR> |
---|
173 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
174 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
175 | <CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</A></CODE></FONT></TD> |
---|
176 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#DEFAULT_MATH_LOCALE">DEFAULT_MATH_LOCALE</A></B></CODE> |
---|
177 | |
---|
178 | <BR> |
---|
179 | Default Locale for DateMath rounding (Locale.US)</TD> |
---|
180 | </TR> |
---|
181 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
182 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
183 | <CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</A></CODE></FONT></TD> |
---|
184 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#DEFAULT_MATH_TZ">DEFAULT_MATH_TZ</A></B></CODE> |
---|
185 | |
---|
186 | <BR> |
---|
187 | Default TimeZone for DateMath rounding (UTC)</TD> |
---|
188 | </TR> |
---|
189 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
190 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
191 | <CODE>static <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</A></CODE></FONT></TD> |
---|
192 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#UTC">UTC</A></B></CODE> |
---|
193 | |
---|
194 | <BR> |
---|
195 | </TD> |
---|
196 | </TR> |
---|
197 | </TABLE> |
---|
198 | |
---|
199 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
200 | |
---|
201 | <A NAME="constructor_summary"><!-- --></A> |
---|
202 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
203 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
204 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
205 | <B>Constructor Summary</B></FONT></TH> |
---|
206 | </TR> |
---|
207 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
208 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#DateMathParser()">DateMathParser</A></B>()</CODE> |
---|
209 | |
---|
210 | <BR> |
---|
211 | Default constructor that assumes UTC should be used for rounding unless |
---|
212 | otherwise specified in the SolrRequestInfo</TD> |
---|
213 | </TR> |
---|
214 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
215 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#DateMathParser(java.util.TimeZone, java.util.Locale)">DateMathParser</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</A> tz, |
---|
216 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</A> l)</CODE> |
---|
217 | |
---|
218 | <BR> |
---|
219 | </TD> |
---|
220 | </TR> |
---|
221 | </TABLE> |
---|
222 | |
---|
223 | <!-- ========== METHOD SUMMARY =========== --> |
---|
224 | |
---|
225 | <A NAME="method_summary"><!-- --></A> |
---|
226 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
227 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
228 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
229 | <B>Method Summary</B></FONT></TH> |
---|
230 | </TR> |
---|
231 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
232 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
233 | <CODE>static void</CODE></FONT></TD> |
---|
234 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#add(java.util.Calendar, int, java.lang.String)">add</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</A> c, |
---|
235 | int val, |
---|
236 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> unit)</CODE> |
---|
237 | |
---|
238 | <BR> |
---|
239 | Modifies the specified Calendar by "adding" the specified value of units</TD> |
---|
240 | </TR> |
---|
241 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
242 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
243 | <CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</A></CODE></FONT></TD> |
---|
244 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#getNow()">getNow</A></B>()</CODE> |
---|
245 | |
---|
246 | <BR> |
---|
247 | Returns a cloned of this instance's concept of "now".</TD> |
---|
248 | </TR> |
---|
249 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
250 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
251 | <CODE> <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</A></CODE></FONT></TD> |
---|
252 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#parseMath(java.lang.String)">parseMath</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> math)</CODE> |
---|
253 | |
---|
254 | <BR> |
---|
255 | Parses a string of commands relative "now" are returns the resulting Date.</TD> |
---|
256 | </TR> |
---|
257 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
258 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
259 | <CODE>static void</CODE></FONT></TD> |
---|
260 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#round(java.util.Calendar, java.lang.String)">round</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</A> c, |
---|
261 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> unit)</CODE> |
---|
262 | |
---|
263 | <BR> |
---|
264 | Modifies the specified Calendar by "rounding" down to the specified unit</TD> |
---|
265 | </TR> |
---|
266 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
267 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
268 | <CODE> void</CODE></FONT></TD> |
---|
269 | <TD><CODE><B><A HREF="../../../../org/apache/solr/util/DateMathParser.html#setNow(java.util.Date)">setNow</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</A> n)</CODE> |
---|
270 | |
---|
271 | <BR> |
---|
272 | Defines this instance's concept of "now".</TD> |
---|
273 | </TR> |
---|
274 | </TABLE> |
---|
275 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
276 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
277 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
278 | <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> |
---|
279 | </TR> |
---|
280 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
281 | <TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> |
---|
282 | </TR> |
---|
283 | </TABLE> |
---|
284 | |
---|
285 | <P> |
---|
286 | |
---|
287 | <!-- ============ FIELD DETAIL =========== --> |
---|
288 | |
---|
289 | <A NAME="field_detail"><!-- --></A> |
---|
290 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
291 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
292 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
293 | <B>Field Detail</B></FONT></TH> |
---|
294 | </TR> |
---|
295 | </TABLE> |
---|
296 | |
---|
297 | <A NAME="UTC"><!-- --></A><H3> |
---|
298 | UTC</H3> |
---|
299 | <PRE> |
---|
300 | public static <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</A> <B>UTC</B></PRE> |
---|
301 | <DL> |
---|
302 | <DL> |
---|
303 | </DL> |
---|
304 | </DL> |
---|
305 | <HR> |
---|
306 | |
---|
307 | <A NAME="DEFAULT_MATH_TZ"><!-- --></A><H3> |
---|
308 | DEFAULT_MATH_TZ</H3> |
---|
309 | <PRE> |
---|
310 | public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</A> <B>DEFAULT_MATH_TZ</B></PRE> |
---|
311 | <DL> |
---|
312 | <DD>Default TimeZone for DateMath rounding (UTC) |
---|
313 | <P> |
---|
314 | <DL> |
---|
315 | </DL> |
---|
316 | </DL> |
---|
317 | <HR> |
---|
318 | |
---|
319 | <A NAME="DEFAULT_MATH_LOCALE"><!-- --></A><H3> |
---|
320 | DEFAULT_MATH_LOCALE</H3> |
---|
321 | <PRE> |
---|
322 | public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</A> <B>DEFAULT_MATH_LOCALE</B></PRE> |
---|
323 | <DL> |
---|
324 | <DD>Default Locale for DateMath rounding (Locale.US) |
---|
325 | <P> |
---|
326 | <DL> |
---|
327 | </DL> |
---|
328 | </DL> |
---|
329 | <HR> |
---|
330 | |
---|
331 | <A NAME="CALENDAR_UNITS"><!-- --></A><H3> |
---|
332 | CALENDAR_UNITS</H3> |
---|
333 | <PRE> |
---|
334 | public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>,<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</A>> <B>CALENDAR_UNITS</B></PRE> |
---|
335 | <DL> |
---|
336 | <DD>A mapping from (uppercased) String labels idenyifying time units, |
---|
337 | to the corresponding Calendar constant used to set/add/roll that unit |
---|
338 | of measurement. |
---|
339 | |
---|
340 | <p> |
---|
341 | A single logical unit of time might be represented by multiple labels |
---|
342 | for convenience (ie: <code>DATE==DAY</code>, |
---|
343 | <code>MILLI==MILLISECOND</code>) |
---|
344 | </p> |
---|
345 | <P> |
---|
346 | <DL> |
---|
347 | <DT><B>See Also:</B><DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><CODE>Calendar</CODE></A></DL> |
---|
348 | </DL> |
---|
349 | |
---|
350 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
351 | |
---|
352 | <A NAME="constructor_detail"><!-- --></A> |
---|
353 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
354 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
355 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
356 | <B>Constructor Detail</B></FONT></TH> |
---|
357 | </TR> |
---|
358 | </TABLE> |
---|
359 | |
---|
360 | <A NAME="DateMathParser()"><!-- --></A><H3> |
---|
361 | DateMathParser</H3> |
---|
362 | <PRE> |
---|
363 | public <B>DateMathParser</B>()</PRE> |
---|
364 | <DL> |
---|
365 | <DD>Default constructor that assumes UTC should be used for rounding unless |
---|
366 | otherwise specified in the SolrRequestInfo |
---|
367 | <P> |
---|
368 | <DL> |
---|
369 | <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/solr/util/DateMathParser.html#DEFAULT_MATH_TZ"><CODE>DEFAULT_MATH_TZ</CODE></A>, |
---|
370 | <A HREF="../../../../org/apache/solr/util/DateMathParser.html#DEFAULT_MATH_LOCALE"><CODE>DEFAULT_MATH_LOCALE</CODE></A></DL> |
---|
371 | </DL> |
---|
372 | <HR> |
---|
373 | |
---|
374 | <A NAME="DateMathParser(java.util.TimeZone, java.util.Locale)"><!-- --></A><H3> |
---|
375 | DateMathParser</H3> |
---|
376 | <PRE> |
---|
377 | public <B>DateMathParser</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</A> tz, |
---|
378 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</A> l)</PRE> |
---|
379 | <DL> |
---|
380 | <DL> |
---|
381 | <DT><B>Parameters:</B><DD><CODE>tz</CODE> - The TimeZone used for rounding (to determine when hours/days begin). If null, then this method defaults to the value dicated by the SolrRequestInfo if it |
---|
382 | exists -- otherwise it uses UTC.<DD><CODE>l</CODE> - The Locale used for rounding (to determine when weeks begin). If null, then this method defaults to en_US.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/solr/util/DateMathParser.html#DEFAULT_MATH_TZ"><CODE>DEFAULT_MATH_TZ</CODE></A>, |
---|
383 | <A HREF="../../../../org/apache/solr/util/DateMathParser.html#DEFAULT_MATH_LOCALE"><CODE>DEFAULT_MATH_LOCALE</CODE></A>, |
---|
384 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html?is-external=true#getInstance(java.util.TimeZone, java.util.Locale)" title="class or interface in java.util"><CODE>Calendar.getInstance(TimeZone,Locale)</CODE></A>, |
---|
385 | <A HREF="../../../../org/apache/solr/request/SolrRequestInfo.html#getClientTimeZone()"><CODE>SolrRequestInfo.getClientTimeZone()</CODE></A></DL> |
---|
386 | </DL> |
---|
387 | |
---|
388 | <!-- ============ METHOD DETAIL ========== --> |
---|
389 | |
---|
390 | <A NAME="method_detail"><!-- --></A> |
---|
391 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
392 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
393 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
394 | <B>Method Detail</B></FONT></TH> |
---|
395 | </TR> |
---|
396 | </TABLE> |
---|
397 | |
---|
398 | <A NAME="add(java.util.Calendar, int, java.lang.String)"><!-- --></A><H3> |
---|
399 | add</H3> |
---|
400 | <PRE> |
---|
401 | public static void <B>add</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</A> c, |
---|
402 | int val, |
---|
403 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> unit)</PRE> |
---|
404 | <DL> |
---|
405 | <DD>Modifies the specified Calendar by "adding" the specified value of units |
---|
406 | <P> |
---|
407 | <DD><DL> |
---|
408 | |
---|
409 | <DT><B>Throws:</B> |
---|
410 | <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if unit isn't recognized.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/solr/util/DateMathParser.html#CALENDAR_UNITS"><CODE>CALENDAR_UNITS</CODE></A></DL> |
---|
411 | </DD> |
---|
412 | </DL> |
---|
413 | <HR> |
---|
414 | |
---|
415 | <A NAME="round(java.util.Calendar, java.lang.String)"><!-- --></A><H3> |
---|
416 | round</H3> |
---|
417 | <PRE> |
---|
418 | public static void <B>round</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</A> c, |
---|
419 | <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> unit)</PRE> |
---|
420 | <DL> |
---|
421 | <DD>Modifies the specified Calendar by "rounding" down to the specified unit |
---|
422 | <P> |
---|
423 | <DD><DL> |
---|
424 | |
---|
425 | <DT><B>Throws:</B> |
---|
426 | <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if unit isn't recognized.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/solr/util/DateMathParser.html#CALENDAR_UNITS"><CODE>CALENDAR_UNITS</CODE></A></DL> |
---|
427 | </DD> |
---|
428 | </DL> |
---|
429 | <HR> |
---|
430 | |
---|
431 | <A NAME="setNow(java.util.Date)"><!-- --></A><H3> |
---|
432 | setNow</H3> |
---|
433 | <PRE> |
---|
434 | public void <B>setNow</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</A> n)</PRE> |
---|
435 | <DL> |
---|
436 | <DD>Defines this instance's concept of "now". |
---|
437 | <P> |
---|
438 | <DD><DL> |
---|
439 | <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/solr/util/DateMathParser.html#getNow()"><CODE>getNow()</CODE></A></DL> |
---|
440 | </DD> |
---|
441 | </DL> |
---|
442 | <HR> |
---|
443 | |
---|
444 | <A NAME="getNow()"><!-- --></A><H3> |
---|
445 | getNow</H3> |
---|
446 | <PRE> |
---|
447 | public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</A> <B>getNow</B>()</PRE> |
---|
448 | <DL> |
---|
449 | <DD>Returns a cloned of this instance's concept of "now". |
---|
450 | |
---|
451 | If setNow was never called (or if null was specified) then this method |
---|
452 | first defines 'now' as the value dictated by the SolrRequestInfo if it |
---|
453 | exists -- otherwise it uses a new Date instance at the moment getNow() |
---|
454 | is first called. |
---|
455 | <P> |
---|
456 | <DD><DL> |
---|
457 | <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/solr/util/DateMathParser.html#setNow(java.util.Date)"><CODE>setNow(java.util.Date)</CODE></A>, |
---|
458 | <A HREF="../../../../org/apache/solr/request/SolrRequestInfo.html#getNOW()"><CODE>SolrRequestInfo.getNOW()</CODE></A></DL> |
---|
459 | </DD> |
---|
460 | </DL> |
---|
461 | <HR> |
---|
462 | |
---|
463 | <A NAME="parseMath(java.lang.String)"><!-- --></A><H3> |
---|
464 | parseMath</H3> |
---|
465 | <PRE> |
---|
466 | public <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</A> <B>parseMath</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> math) |
---|
467 | throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/text/ParseException.html?is-external=true" title="class or interface in java.text">ParseException</A></PRE> |
---|
468 | <DL> |
---|
469 | <DD>Parses a string of commands relative "now" are returns the resulting Date. |
---|
470 | <P> |
---|
471 | <DD><DL> |
---|
472 | |
---|
473 | <DT><B>Throws:</B> |
---|
474 | <DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/text/ParseException.html?is-external=true" title="class or interface in java.text">ParseException</A></CODE> - positions in ParseExceptions are token positions, not character positions.</DL> |
---|
475 | </DD> |
---|
476 | </DL> |
---|
477 | <!-- ========= END OF CLASS DATA ========= --> |
---|
478 | <HR> |
---|
479 | |
---|
480 | |
---|
481 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
482 | <A NAME="navbar_bottom"><!-- --></A> |
---|
483 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
484 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
485 | <TR> |
---|
486 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
487 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
488 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
489 | <TR ALIGN="center" VALIGN="top"> |
---|
490 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
491 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
492 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
493 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DateMathParser.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
494 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
495 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
496 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
497 | </TR> |
---|
498 | </TABLE> |
---|
499 | </TD> |
---|
500 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
501 | </EM> |
---|
502 | </TD> |
---|
503 | </TR> |
---|
504 | |
---|
505 | <TR> |
---|
506 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
507 | <A HREF="../../../../org/apache/solr/util/ConcurrentLRUCache.Stats.html" title="class in org.apache.solr.util"><B>PREV CLASS</B></A> |
---|
508 | <A HREF="../../../../org/apache/solr/util/DefaultSolrThreadFactory.html" title="class in org.apache.solr.util"><B>NEXT CLASS</B></A></FONT></TD> |
---|
509 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
510 | <A HREF="../../../../index.html?org/apache/solr/util/DateMathParser.html" target="_top"><B>FRAMES</B></A> |
---|
511 | <A HREF="DateMathParser.html" target="_top"><B>NO FRAMES</B></A> |
---|
512 | <SCRIPT type="text/javascript"> |
---|
513 | <!-- |
---|
514 | if(window==top) { |
---|
515 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
516 | } |
---|
517 | //--> |
---|
518 | </SCRIPT> |
---|
519 | <NOSCRIPT> |
---|
520 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
521 | </NOSCRIPT> |
---|
522 | |
---|
523 | |
---|
524 | </FONT></TD> |
---|
525 | </TR> |
---|
526 | <TR> |
---|
527 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
528 | SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
529 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
530 | DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
531 | </TR> |
---|
532 | </TABLE> |
---|
533 | <A NAME="skip-navbar_bottom"></A> |
---|
534 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
535 | |
---|
536 | <HR> |
---|
537 | |
---|
538 | <address>Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.</address> |
---|
539 | <script src='../../../../prettify.js' type='text/javascript'></script> |
---|
540 | <script type='text/javascript'> |
---|
541 | (function(){ |
---|
542 | var oldonload = window.onload; |
---|
543 | if (typeof oldonload != 'function') { |
---|
544 | window.onload = prettyPrint; |
---|
545 | } else { |
---|
546 | window.onload = function() { |
---|
547 | oldonload(); |
---|
548 | prettyPrint(); |
---|
549 | } |
---|
550 | } |
---|
551 | })(); |
---|
552 | </script> |
---|
553 | |
---|
554 | </BODY> |
---|
555 | </HTML> |
---|