Author: stevencaswell
Date: Sun Jun 26 10:48:18 2005
New Revision: 201883
URL: http://svn.apache.org/viewcvs?rev=201883&view=rev
Log:
corrected style issues (mostly empty blocks and missing javadocs)
Modified:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateUtils.java
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
Modified:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java?rev=201883&r1=201882&r2=201883&view=diff
==============================================================================
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java
(original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java
Sun Jun 26 10:48:18 2005
@@ -112,6 +112,7 @@
* to operate.</p>
*/
public DateFormatUtils() {
+ ; // empty constructor
}
/**
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=201883&r1=201882&r2=201883&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 Jun 26 10:48:18 2005
@@ -120,6 +120,7 @@
* instance to operate.</p>
*/
public DateUtils() {
+ ; // empty constructor
}
//-----------------------------------------------------------------------
Modified:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java?rev=201883&r1=201882&r2=201883&view=diff
==============================================================================
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
(original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
Sun Jun 26 10:48:18 2005
@@ -1013,7 +1013,19 @@
* <p>Inner class defining a rule.</p>
*/
private interface Rule {
+ /**
+ * Returns the estimated lentgh of the result.
+ *
+ * @return the estimated length
+ */
int estimateLength();
+
+ /**
+ * Appends the value of the specified calendar to the output buffer
based on the rule implementation.
+ *
+ * @param buffer the output buffer
+ * @param calendar calendar to be appended
+ */
void appendTo(StringBuffer buffer, Calendar calendar);
}
@@ -1021,6 +1033,12 @@
* <p>Inner class defining a numeric rule.</p>
*/
private interface NumberRule extends Rule {
+ /**
+ * Appends the specified value to the output buffer based on the rule
implementation.
+ *
+ * @param buffer the output buffer
+ * @param value the value to be appended
+ */
void appendTo(StringBuffer buffer, int value);
}
@@ -1030,14 +1048,26 @@
private static class CharacterLiteral implements Rule {
private final char mValue;
+ /**
+ * Constructs a new instance of <code>CharacterLiteral</code>
+ * to hold the specified value.
+ *
+ * @param value the character literal
+ */
CharacterLiteral(char value) {
mValue = value;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 1;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
buffer.append(mValue);
}
@@ -1049,14 +1079,26 @@
private static class StringLiteral implements Rule {
private final String mValue;
+ /**
+ * Constructs a new instance of <code>StringLiteral</code>
+ * to hold the specified value.
+ *
+ * @param value the string literal
+ */
StringLiteral(String value) {
mValue = value;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return mValue.length();
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
buffer.append(mValue);
}
@@ -1069,11 +1111,21 @@
private final int mField;
private final String[] mValues;
+ /**
+ * Constructs an instance of <code>TextField</code>
+ * with the specified field and values.
+ *
+ * @param field the field
+ * @param values the field values
+ */
TextField(int field, String[] values) {
mField = field;
mValues = values;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
int max = 0;
for (int i=mValues.length; --i >= 0; ) {
@@ -1085,6 +1137,9 @@
return max;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
buffer.append(mValues[calendar.get(mField)]);
}
@@ -1098,18 +1153,32 @@
private final int mField;
+ /**
+ * Constructs an instance of <code>UnpadedNumberField</code> with the
specified field.
+ *
+ * @param field the field
+ */
UnpaddedNumberField(int field) {
mField = field;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 4;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(mField));
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public final void appendTo(StringBuffer buffer, int value) {
if (value < 10) {
buffer.append((char)(value + '0'));
@@ -1127,18 +1196,32 @@
*/
private static class UnpaddedMonthField implements NumberRule {
static final UnpaddedMonthField INSTANCE = new UnpaddedMonthField();
-
+
+ /**
+ * Constructs an instance of <code>UnpaddedMonthField</code>.
+ *
+ */
UnpaddedMonthField() {
+ ; // empty constructor
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 2;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public final void appendTo(StringBuffer buffer, int value) {
if (value < 10) {
buffer.append((char)(value + '0'));
@@ -1156,6 +1239,12 @@
private final int mField;
private final int mSize;
+ /**
+ * Constructs an instance of <code>PaddedNumberField</code>.
+ *
+ * @param field the field
+ * @param size size of the output field
+ */
PaddedNumberField(int field, int size) {
if (size < 3) {
// Should use UnpaddedNumberField or TwoDigitNumberField.
@@ -1165,14 +1254,23 @@
mSize = size;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 4;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(mField));
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public final void appendTo(StringBuffer buffer, int value) {
if (value < 100) {
for (int i = mSize; --i >= 2; ) {
@@ -1201,18 +1299,32 @@
private static class TwoDigitNumberField implements NumberRule {
private final int mField;
+ /**
+ * Constructs an instance of <code>TwoDigitNumberField</code> with the
specified field.
+ *
+ * @param field the field
+ */
TwoDigitNumberField(int field) {
mField = field;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 2;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(mField));
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public final void appendTo(StringBuffer buffer, int value) {
if (value < 100) {
buffer.append((char)(value / 10 + '0'));
@@ -1228,18 +1340,31 @@
*/
private static class TwoDigitYearField implements NumberRule {
static final TwoDigitYearField INSTANCE = new TwoDigitYearField();
-
+
+ /**
+ * Constructs an instance of <code>TwoDigitYearField</code>.
+ */
TwoDigitYearField() {
+ ; // empty constructor
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 2;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(Calendar.YEAR) % 100);
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public final void appendTo(StringBuffer buffer, int value) {
buffer.append((char)(value / 10 + '0'));
buffer.append((char)(value % 10 + '0'));
@@ -1251,18 +1376,31 @@
*/
private static class TwoDigitMonthField implements NumberRule {
static final TwoDigitMonthField INSTANCE = new TwoDigitMonthField();
-
+
+ /**
+ * Constructs an instance of <code>TwoDigitMonthField</code>.
+ */
TwoDigitMonthField() {
+ ; // empty constructor
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 2;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public final void appendTo(StringBuffer buffer, int value) {
buffer.append((char)(value / 10 + '0'));
buffer.append((char)(value % 10 + '0'));
@@ -1275,14 +1413,26 @@
private static class TwelveHourField implements NumberRule {
private final NumberRule mRule;
+ /**
+ * Constructs an instance of <code>TwelveHourField</code> with the
specified
+ * <code>NumberRule</code>.
+ *
+ * @param rule the rule
+ */
TwelveHourField(NumberRule rule) {
mRule = rule;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return mRule.estimateLength();
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
int value = calendar.get(Calendar.HOUR);
if (value == 0) {
@@ -1291,6 +1441,9 @@
mRule.appendTo(buffer, value);
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, int value) {
mRule.appendTo(buffer, value);
}
@@ -1302,14 +1455,26 @@
private static class TwentyFourHourField implements NumberRule {
private final NumberRule mRule;
+ /**
+ * Constructs an instance of <code>TwentyFourHourField</code> with the
specified
+ * <code>NumberRule</code>.
+ *
+ * @param rule the rule
+ */
TwentyFourHourField(NumberRule rule) {
mRule = rule;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return mRule.estimateLength();
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
int value = calendar.get(Calendar.HOUR_OF_DAY);
if (value == 0) {
@@ -1318,6 +1483,9 @@
mRule.appendTo(buffer, value);
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, int value) {
mRule.appendTo(buffer, value);
}
@@ -1334,6 +1502,14 @@
private final String mStandard;
private final String mDaylight;
+ /**
+ * Constructs an instance of <code>TimeZoneNameRule</code> with the
specified properties.
+ *
+ * @param timeZone the time zone
+ * @param timeZoneForced if <code>true</code> the time zone is forced
into standard and daylight
+ * @param locale the locale
+ * @param style the style
+ */
TimeZoneNameRule(TimeZone timeZone, boolean timeZoneForced, Locale
locale, int style) {
mTimeZone = timeZone;
mTimeZoneForced = timeZoneForced;
@@ -1349,6 +1525,9 @@
}
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
if (mTimeZoneForced) {
return Math.max(mStandard.length(), mDaylight.length());
@@ -1359,6 +1538,9 @@
}
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
if (mTimeZoneForced) {
if (mTimeZone.useDaylightTime() &&
calendar.get(Calendar.DST_OFFSET) != 0) {
@@ -1387,14 +1569,25 @@
final boolean mColon;
+ /**
+ * Constructs an instance of <code>TimeZoneNumberRule</code> with the
specified properties.
+ *
+ * @param colon add colon between HH and MM in the output if
<code>true</code>
+ */
TimeZoneNumberRule(boolean colon) {
mColon = colon;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int estimateLength() {
return 5;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public void appendTo(StringBuffer buffer, Calendar calendar) {
int offset = calendar.get(Calendar.ZONE_OFFSET) +
calendar.get(Calendar.DST_OFFSET);
@@ -1428,6 +1621,14 @@
private final int mStyle;
private final Locale mLocale;
+ /**
+ * Constructs an instance of <code>TimeZoneDisplayKey</code> with the
specified properties.
+ *
+ * @param timeZone the time zone
+ * @param daylight adjust the style for daylight saving time if
<code>true</code>
+ * @param style the timezone style
+ * @param locale the timezone locale
+ */
TimeZoneDisplayKey(TimeZone timeZone,
boolean daylight, int style, Locale locale) {
mTimeZone = timeZone;
@@ -1438,10 +1639,16 @@
mLocale = locale;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int hashCode() {
return mStyle * 31 + mLocale.hashCode();
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -1468,11 +1675,19 @@
private final Object mObj1;
private final Object mObj2;
+ /**
+ * Constructs an instance of <code>Pair</code> to hold the specified
objects.
+ * @param obj1 one object in the pair
+ * @param obj2 second object in the pair
+ */
public Pair(Object obj1, Object obj2) {
mObj1 = obj1;
mObj2 = obj2;
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -1491,12 +1706,18 @@
key.mObj2 == null : mObj2.equals(key.mObj2));
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public int hashCode() {
return
(mObj1 == null ? 0 : mObj1.hashCode()) +
(mObj2 == null ? 0 : mObj2.hashCode());
}
+ /**
+ * [EMAIL PROTECTED]
+ */
public String toString() {
return "[" + mObj1 + ':' + mObj2 + ']';
}
Modified:
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java?rev=201883&r1=201882&r2=201883&view=diff
==============================================================================
---
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
(original)
+++
jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/StopWatch.java
Sun Jun 26 10:48:18 2005
@@ -82,6 +82,7 @@
* <p>Constructor.</p>
*/
public StopWatch() {
+ ; // empty constructor
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]