From f68bbdbbb551da3f02eb50f323c10d9d78d9a4d0 Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Fri, 4 Mar 2011 13:41:41 +0000 Subject: [PATCH] Javadoc git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1077942 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang3/time/DateFormatUtils.java | 54 +++++++++---------- .../lang3/time/DurationFormatUtils.java | 39 +++++++------- 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java index 2a01f3091..f7289ca00 100644 --- a/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java @@ -24,7 +24,7 @@ import java.util.TimeZone; /** *

Date and time formatting utilities and constants.

* - *

Formatting is performed using the + *

Formatting is performed using the thread-safe * {@link org.apache.commons.lang3.time.FastDateFormat} class.

* * @author Apache Software Foundation @@ -121,7 +121,7 @@ public class DateFormatUtils { *

Formats a date/time into a specific pattern using the UTC time zone.

* * @param millis the date to format expressed in milliseconds - * @param pattern the pattern to use to format the date + * @param pattern the pattern to use to format the date, not null * @return the formatted date */ public static String formatUTC(long millis, String pattern) { @@ -131,8 +131,8 @@ public class DateFormatUtils { /** *

Formats a date/time into a specific pattern using the UTC time zone.

* - * @param date the date to format - * @param pattern the pattern to use to format the date + * @param date the date to format, not null + * @param pattern the pattern to use to format the date, not null * @return the formatted date */ public static String formatUTC(Date date, String pattern) { @@ -143,7 +143,7 @@ public class DateFormatUtils { *

Formats a date/time into a specific pattern using the UTC time zone.

* * @param millis the date to format expressed in milliseconds - * @param pattern the pattern to use to format the date + * @param pattern the pattern to use to format the date, not null * @param locale the locale to use, may be null * @return the formatted date */ @@ -154,8 +154,8 @@ public class DateFormatUtils { /** *

Formats a date/time into a specific pattern using the UTC time zone.

* - * @param date the date to format - * @param pattern the pattern to use to format the date + * @param date the date to format, not null + * @param pattern the pattern to use to format the date, not null * @param locale the locale to use, may be null * @return the formatted date */ @@ -167,7 +167,7 @@ public class DateFormatUtils { *

Formats a date/time into a specific pattern.

* * @param millis the date to format expressed in milliseconds - * @param pattern the pattern to use to format the date + * @param pattern the pattern to use to format the date, not null * @return the formatted date */ public static String format(long millis, String pattern) { @@ -177,8 +177,8 @@ public class DateFormatUtils { /** *

Formats a date/time into a specific pattern.

* - * @param date the date to format - * @param pattern the pattern to use to format the date + * @param date the date to format, not null + * @param pattern the pattern to use to format the date, not null * @return the formatted date */ public static String format(Date date, String pattern) { @@ -188,8 +188,8 @@ public class DateFormatUtils { /** *

Formats a calendar into a specific pattern.

* - * @param calendar the calendar to format - * @param pattern the pattern to use to format the calendar + * @param calendar the calendar to format, not null + * @param pattern the pattern to use to format the calendar, not null * @return the formatted calendar * @see FastDateFormat#format(Calendar) * @since 2.4 @@ -202,7 +202,7 @@ public class DateFormatUtils { *

Formats a date/time into a specific pattern in a time zone.

* * @param millis the time expressed in milliseconds - * @param pattern the pattern to use to format the date + * @param pattern the pattern to use to format the date, not null * @param timeZone the time zone to use, may be null * @return the formatted date */ @@ -213,8 +213,8 @@ public class DateFormatUtils { /** *

Formats a date/time into a specific pattern in a time zone.

* - * @param date the date to format - * @param pattern the pattern to use to format the date + * @param date the date to format, not null + * @param pattern the pattern to use to format the date, not null * @param timeZone the time zone to use, may be null * @return the formatted date */ @@ -225,8 +225,8 @@ public class DateFormatUtils { /** *

Formats a calendar into a specific pattern in a time zone.

* - * @param calendar the calendar to format - * @param pattern the pattern to use to format the calendar + * @param calendar the calendar to format, not null + * @param pattern the pattern to use to format the calendar, not null * @param timeZone the time zone to use, may be null * @return the formatted calendar * @see FastDateFormat#format(Calendar) @@ -240,7 +240,7 @@ public class DateFormatUtils { *

Formats a date/time into a specific pattern in a locale.

* * @param millis the date to format expressed in milliseconds - * @param pattern the pattern to use to format the date + * @param pattern the pattern to use to format the date, not null * @param locale the locale to use, may be null * @return the formatted date */ @@ -251,8 +251,8 @@ public class DateFormatUtils { /** *

Formats a date/time into a specific pattern in a locale.

* - * @param date the date to format - * @param pattern the pattern to use to format the date + * @param date the date to format, not null + * @param pattern the pattern to use to format the date, not null * @param locale the locale to use, may be null * @return the formatted date */ @@ -263,8 +263,8 @@ public class DateFormatUtils { /** *

Formats a calendar into a specific pattern in a locale.

* - * @param calendar the calendar to format - * @param pattern the pattern to use to format the calendar + * @param calendar the calendar to format, not null + * @param pattern the pattern to use to format the calendar, not null * @param locale the locale to use, may be null * @return the formatted calendar * @see FastDateFormat#format(Calendar) @@ -278,7 +278,7 @@ public class DateFormatUtils { *

Formats a date/time into a specific pattern in a time zone and locale.

* * @param millis the date to format expressed in milliseconds - * @param pattern the pattern to use to format the date + * @param pattern the pattern to use to format the date, not null * @param timeZone the time zone to use, may be null * @param locale the locale to use, may be null * @return the formatted date @@ -290,8 +290,8 @@ public class DateFormatUtils { /** *

Formats a date/time into a specific pattern in a time zone and locale.

* - * @param date the date to format - * @param pattern the pattern to use to format the date + * @param date the date to format, not null + * @param pattern the pattern to use to format the date, not null, not null * @param timeZone the time zone to use, may be null * @param locale the locale to use, may be null * @return the formatted date @@ -304,8 +304,8 @@ public class DateFormatUtils { /** *

Formats a calendar into a specific pattern in a time zone and locale.

* - * @param calendar the calendar to format - * @param pattern the pattern to use to format the calendar + * @param calendar the calendar to format, not null + * @param pattern the pattern to use to format the calendar, not null * @param timeZone the time zone to use, may be null * @param locale the locale to use, may be null * @return the formatted calendar diff --git a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java index 1a2e50aea..379f5bccc 100644 --- a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java @@ -75,7 +75,7 @@ public class DurationFormatUtils { * H:m:s.S.

* * @param durationMillis the duration to format - * @return the time as a String + * @return the formatted duration, not null */ public static String formatDurationHMS(long durationMillis) { return formatDuration(durationMillis, "H:mm:ss.SSS"); @@ -90,7 +90,7 @@ public class DurationFormatUtils { * ISO format pattern, such as P7D6TH5M4.321S.

* * @param durationMillis the duration to format - * @return the time as a String + * @return the formatted duration, not null */ public static String formatDurationISO(long durationMillis) { return formatDuration(durationMillis, ISO_EXTENDED_FORMAT_PATTERN, false); @@ -104,8 +104,8 @@ public class DurationFormatUtils { * format pattern. Months and larger are not used.

* * @param durationMillis the duration to format - * @param format the way in which to format the duration - * @return the time as a String + * @param format the way in which to format the duration, not null + * @return the formatted duration, not null */ public static String formatDuration(long durationMillis, String format) { return formatDuration(durationMillis, format, true); @@ -120,9 +120,9 @@ public class DurationFormatUtils { * format pattern. Months and larger are not used.

* * @param durationMillis the duration to format - * @param format the way in which to format the duration + * @param format the way in which to format the duration, not null * @param padWithZeros whether to pad the left hand side of numbers with 0's - * @return the time as a String + * @return the formatted duration, not null */ public static String formatDuration(long durationMillis, String format, boolean padWithZeros) { @@ -166,7 +166,7 @@ public class DurationFormatUtils { * @param durationMillis the elapsed time to report in milliseconds * @param suppressLeadingZeroElements suppresses leading 0 elements * @param suppressTrailingZeroElements suppresses trailing 0 elements - * @return the formatted text in days/hours/minutes/seconds + * @return the formatted text in days/hours/minutes/seconds, not null */ public static String formatDurationWords( long durationMillis, @@ -229,7 +229,7 @@ public class DurationFormatUtils { * * @param startMillis the start of the duration to format * @param endMillis the end of the duration to format - * @return the time as a String + * @return the formatted duration, not null */ public static String formatPeriodISO(long startMillis, long endMillis) { return formatPeriod(startMillis, endMillis, ISO_EXTENDED_FORMAT_PATTERN, false, TimeZone.getDefault()); @@ -241,8 +241,8 @@ public class DurationFormatUtils { * * @param startMillis the start of the duration * @param endMillis the end of the duration - * @param format the way in which to format the duration - * @return the time as a String + * @param format the way in which to format the duration, not null + * @return the formatted duration, not null */ public static String formatPeriod(long startMillis, long endMillis, String format) { return formatPeriod(startMillis, endMillis, format, true, TimeZone.getDefault()); @@ -266,10 +266,10 @@ public class DurationFormatUtils { * * @param startMillis the start of the duration * @param endMillis the end of the duration - * @param format the way in which to format the duration - * @param padWithZeros whether to pad the left hand side of numbers with 0's - * @param timezone the millis are defined in - * @return the time as a String + * @param format the way in which to format the duration, not null + * @param padWithZeros whether to pad the left hand side of numbers with 0's + * @param timezone the millis are defined in + * @return the formatted duration, not null */ public static String formatPeriod(long startMillis, long endMillis, String format, boolean padWithZeros, TimeZone timezone) { @@ -482,7 +482,7 @@ public class DurationFormatUtils { /** * Parses a classic date format string into Tokens * - * @param format to parse + * @param format the format to parse, not null * @return array of Token[] */ static Token[] lexx(String format) { @@ -541,6 +541,7 @@ public class DurationFormatUtils { return list.toArray( new Token[list.size()] ); } + //----------------------------------------------------------------------- /** * Element that is parsed from the format pattern. */ @@ -641,11 +642,11 @@ public class DurationFormatUtils { } /** - * Returns a hashcode for the token equal to the - * hashcode for the token's value. Thus 'TT' and 'TTTT' - * will have the same hashcode. + * Returns a hash code for the token equal to the + * hash code for the token's value. Thus 'TT' and 'TTTT' + * will have the same hash code. * - * @return The hashcode for the token + * @return The hash code for the token */ @Override public int hashCode() {