📄 repeatrule.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Feb 10 18:18:41 PST 2003 -->
<TITLE>
RepeatRule (PIM Optional Package 1.0 Spec, Proposed Final Draft)
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.pim.RepeatRule,RepeatRule class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="RepeatRule (PIM Optional Package 1.0 Spec, Proposed Final Draft)";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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>
PIM Optional Package 1.0<br>Proposed Final Draft</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../javax/microedition/pim/PIM.html"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="RepeatRule.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><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>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.pim</FONT>
<BR>
Class RepeatRule</H2>
<PRE>
java.lang.Object
|
+--<B>javax.microedition.pim.RepeatRule</B>
</PRE>
<HR>
<DL>
<DT>public class <B>RepeatRule</B><DT>extends java.lang.Object</DL>
<P>
Represents a description for a repeating pattern for an Event item. The fields are a subset of the capabilities of the RRULE field in VEVENT defined by the vCalendar 1.0 specification from the Internet Mail Consortium (http://www.imc.org). It is use to determine how often an associated Event occurs. <P> The following table shows the valid values for the fields that can be set in RepeatRule: <table BORDER=1> <TR> <th> Fields </th><th> Set Method </th><th> Valid Values </th> </tr> <tr><td><code>COUNT</code></td> <td><code>setInt</code></td> <td>any positive int</td> </tr> <tr><td><code>FREQUENCY</code></td> <td><code>setInt</code></td> <td><code>DAILY, WEEKLY, MONTHLY, YEARLY</td> </tr> <tr><td><code>INTERVAL</code></td> <td><code>setInt</code></td> <td>any positive int</td> </tr> <tr><td><code>END</code></td> <td><code>setDate</code></td> <td>any valid Date</td> </tr> <tr><td><code>MONTH_IN_YEAR</code></td> <td><code>setInt</code></td> <td><code>JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER</code> (Note: that these are constants defined in the RepeatRule class and are not the same as those in the Calendar class)</td> </tr> <tr><td><code>DAY_IN_WEEK</code></td> <td><code>setInt</code></td> <td><CODE>SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY </CODE>(Note: that these are constants defined in the RepeatRule class and are not the same as those in the Calendar class)</td> </tr> <tr><td><code>WEEK_IN_MONTH</code></td> <td><code>setInt</code></td> <td><CODE>FIRST, SECOND, THIRD, FOURTH, FIFTH, LAST, SECONDLAST, THIRDLAST, FOURTHLAST, FIFTHLAST</CODE></td> </tr> <tr><td><code>DAY_IN_MONTH</code></td> <td><code>setInt</code></td> <td>1-31</td> <tr><td><code>DAY_IN_YEAR</code></td> <td><code>setInt</code></td> <td>1-366</td> </tr> </tr> </table> <h3>Examples</h3> <P>The following examples demonstrate some possible repeat values.</P> To specify the associated event occurs every day: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.DAILY);</code></pre> To specify the associated event occurs every day for the next five days: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.DAILY); setInt(RepeatRule.COUNT, 5);</code></pre> To specify this event occurs every week on Monday and Tuesday: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.WEEKLY); setInt(RepeatRule.DAY_IN_WEEK, RepeatRule.MONDAY | RepeatRule.TUESDAY);</code></pre> To specify the associated event occurs every third week on Friday: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.WEEKLY); setInt(RepeatRule.INTERVAL, 3); setInt(RepeatRule.DAY_IN_WEEK, RepeatRule.FRIDAY);</code></pre> To specify the associated event occurs every month on the Wednesday of the second week until the end of the current year: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.MONTHLY); setInt(RepeatRule.WEEK_IN_MONTH, RepeatRule.SECOND); setInt(RepeatRule.DAY_IN_WEEK, RepeatRule.WEDNESDAY); java.util.Calendar cal = Calendar.getInstance(); cal.set(Calendar.MONTH, Calendar.DECEMBER); cal.set(Calendar.DAY_OF_MONTH, 31); cal.set(Calendar.AM_PM, Calendar.PM); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 59); setDate(RepeatRule.END, cal.getTime().getTime());</code></pre> To specify the associated event occurs every year on the Sunday of the second week in May: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.YEARLY); setInt(RepeatRule.MONTH_IN_YEAR, RepeatRule.MAY); setInt(RepeatRule.WEEK_IN_MONTH, RepeatRule.SECOND); setInt(RepeatRule.DAY_IN_WEEK, RepeatRule.SUNDAY);</code></pre> To specify the associated event occurs every year on the 4th of July: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.YEARLY); setInt(RepeatRule.MONTH_IN_YEAR, RepeatRule.JULY); setInt(RepeatRule.DAY_IN_MONTH, 4);</code></pre> To specify the associated event occurs every year on the first day: <br> <pre><code> setInt(RepeatRule.FREQUENCY, RepeatRule.YEARLY); setInt(RepeatRule.DAY_IN_YEAR, 1);</code></pre>
<P>
<P>
<DL>
<DT><B>Since:</B></DT> <DD>PIM 1.0</DD></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#APRIL">APRIL</A></B></CODE>
<BR>
Constant for the month of April used with <code>MONTH_IN_YEAR</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#AUGUST">AUGUST</A></B></CODE>
<BR>
Constant for the month of August used with <code>MONTH_IN_YEAR</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#COUNT">COUNT</A></B></CODE>
<BR>
Field specifying the number of times this event repeats including the first time, starting from the first time the event starts (derived from <code>Event.START</code>) and continuing to the last date of the repeat (defined by <code>RepeatRule.END</code>).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#DAILY">DAILY</A></B></CODE>
<BR>
Used for frequency when the Event happens every day.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#DAY_IN_MONTH">DAY_IN_MONTH</A></B></CODE>
<BR>
Field specifying the day of the month an Event occurs; for example, 15.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#DAY_IN_WEEK">DAY_IN_WEEK</A></B></CODE>
<BR>
Field specifying the days of the week an Event occurs.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#DAY_IN_YEAR">DAY_IN_YEAR</A></B></CODE>
<BR>
Field specifying the day of the year an Event occurs; for example, 134.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#DECEMBER">DECEMBER</A></B></CODE>
<BR>
Constant for the month of December used with <code>MONTH_IN_YEAR</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#END">END</A></B></CODE>
<BR>
Field specifying the ending date of the repeating event.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FEBRUARY">FEBRUARY</A></B></CODE>
<BR>
Constant for the month of February used with <code>MONTH_IN_YEAR</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FIFTH">FIFTH</A></B></CODE>
<BR>
Constant for the fifth week of the month used with <code>WEEK_OF_MONTH</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FIFTHLAST">FIFTHLAST</A></B></CODE>
<BR>
Constant for the fifth to last week of the month used with <code>WEEK_OF_MONTH</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FIRST">FIRST</A></B></CODE>
<BR>
Constant for the first week of the month used with <code>WEEK_OF_MONTH</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FOURTH">FOURTH</A></B></CODE>
<BR>
Constant for the fourth week of the month used with <code>WEEK_OF_MONTH</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FOURTHLAST">FOURTHLAST</A></B></CODE>
<BR>
Constant for the fourth to last week of the month used with <code>WEEK_OF_MONTH</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FREQUENCY">FREQUENCY</A></B></CODE>
<BR>
Field specifying the frequency of the Repeat.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#FRIDAY">FRIDAY</A></B></CODE>
<BR>
Constant for the day of week Friday used with <code>DAY_IN_WEEK</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#INTERVAL">INTERVAL</A></B></CODE>
<BR>
Field specifying the number of iterations of the frequency between occurring dates, or how often the frequency repeats.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#JANUARY">JANUARY</A></B></CODE>
<BR>
Constant for the month of January used with <code>MONTH_IN_YEAR</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/RepeatRule.html#JULY">JULY</A></B></CODE>
<BR>
Constant for the month of July used with <code>MONTH_IN_YEAR</code> field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -