Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 97336 invoked from network); 16 Apr 2006 20:55:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Apr 2006 20:55:50 -0000 Received: (qmail 42963 invoked by uid 500); 16 Apr 2006 20:55:48 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 42888 invoked by uid 500); 16 Apr 2006 20:55:48 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 42877 invoked by uid 500); 16 Apr 2006 20:55:48 -0000 Received: (qmail 42874 invoked by uid 99); 16 Apr 2006 20:55:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Apr 2006 13:55:48 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 16 Apr 2006 13:55:47 -0700 Received: (qmail 97249 invoked by uid 65534); 16 Apr 2006 20:55:27 -0000 Message-ID: <20060416205527.97248.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r394555 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java Date: Sun, 16 Apr 2006 20:55:26 -0000 To: commons-cvs@jakarta.apache.org From: scolebourne@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: scolebourne Date: Sun Apr 16 13:55:25 2006 New Revision: 394555 URL: http://svn.apache.org/viewcvs?rev=394555&view=rev Log: Javadoc to explain what iterator methods actually do bug 33609 Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java?rev=394555&r1=394554&r2=394555&view=diff ============================================================================== --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java Sun Apr 16 13:55:25 2006 @@ -697,22 +697,28 @@ //----------------------------------------------------------------------- /** - *

This constructs an Iterator that will - * start and stop over a date range based on the focused - * date and the range style.

+ *

This constructs an Iterator over each day in a date + * range defined by a focus date and range style.

* *

For instance, passing Thursday, July 4, 2002 and a - * RANGE_MONTH_SUNDAY will return an - * Iterator that starts with Sunday, June 30, - * 2002 and ends with Saturday, August 3, 2002. - * - * @param focus the date to work with - * @param rangeStyle the style constant to use. Must be one of the range - * styles listed for the {@link #iterator(Calendar, int)} method. + * RANGE_MONTH_SUNDAY will return an Iterator + * that starts with Sunday, June 30, 2002 and ends with Saturday, August 3, + * 2002, returning a Calendar instance for each intermediate day.

* - * @return the date iterator - * @throws IllegalArgumentException if the date is null or if - * the rangeStyle is not + *

This method provides an iterator that returns Calendar objects. + * The days are progressed using {@link Calendar#add(int, int)}.

+ * + * @param focus the date to work with, not null + * @param rangeStyle the style constant to use. Must be one of + * {@link DateUtils#RANGE_MONTH_SUNDAY}, + * {@link DateUtils#RANGE_MONTH_MONDAY}, + * {@link DateUtils#RANGE_WEEK_SUNDAY}, + * {@link DateUtils#RANGE_WEEK_MONDAY}, + * {@link DateUtils#RANGE_WEEK_RELATIVE}, + * {@link DateUtils#RANGE_WEEK_CENTER} + * @return the date iterator, which always returns Calendar instances + * @throws IllegalArgumentException if the date is null + * @throws IllegalArgumentException if the rangeStyle is invalid */ public static Iterator iterator(Date focus, int rangeStyle) { if (focus == null) { @@ -724,15 +730,17 @@ } /** - *

This constructs an Iterator that will - * start and stop over a date range based on the focused - * date and the range style.

+ *

This constructs an Iterator over each day in a date + * range defined by a focus date and range style.

* *

For instance, passing Thursday, July 4, 2002 and a - * RANGE_MONTH_SUNDAY will return an - * Iterator that starts with Sunday, June 30, - * 2002 and ends with Saturday, August 3, 2002. - * + * RANGE_MONTH_SUNDAY will return an Iterator + * that starts with Sunday, June 30, 2002 and ends with Saturday, August 3, + * 2002, returning a Calendar instance for each intermediate day.

+ * + *

This method provides an iterator that returns Calendar objects. + * The days are progressed using {@link Calendar#add(int, int)}.

+ * * @param focus the date to work with * @param rangeStyle the style constant to use. Must be one of * {@link DateUtils#RANGE_MONTH_SUNDAY}, @@ -743,6 +751,7 @@ * {@link DateUtils#RANGE_WEEK_CENTER} * @return the date iterator * @throws IllegalArgumentException if the date is null + * @throws IllegalArgumentException if the rangeStyle is invalid */ public static Iterator iterator(Calendar focus, int rangeStyle) { if (focus == null) { @@ -817,15 +826,14 @@ } /** - *

This constructs an Iterator that will - * start and stop over a date range based on the focused - * date and the range style.

+ *

This constructs an Iterator over each day in a date + * range defined by a focus date and range style.

* *

For instance, passing Thursday, July 4, 2002 and a - * RANGE_MONTH_SUNDAY will return an - * Iterator that starts with Sunday, June 30, - * 2002 and ends with Saturday, August 3, 2002.

- * + * RANGE_MONTH_SUNDAY will return an Iterator + * that starts with Sunday, June 30, 2002 and ends with Saturday, August 3, + * 2002, returning a Calendar instance for each intermediate day.

+ * * @param focus the date to work with, either * Date or Calendar * @param rangeStyle the style constant to use. Must be one of the range --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org