From 31018d5b041f9bdbac50d50dbba3189c8c9b921b Mon Sep 17 00:00:00 2001 From: samskivert Date: Wed, 26 Aug 2009 21:15:07 +0000 Subject: [PATCH] Nixed the year/month/day setters as those are obviated by obtaining an instances configured to the desired year month and day. Also added the requisite warning about using the Calendar month constants to the appropriate at() method. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2622 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Calendars.java | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/java/com/samskivert/util/Calendars.java b/src/java/com/samskivert/util/Calendars.java index a1daade6..1a1d9e39 100644 --- a/src/java/com/samskivert/util/Calendars.java +++ b/src/java/com/samskivert/util/Calendars.java @@ -48,35 +48,18 @@ public class Calendars /** Provides fluent methods for operating on a {@link Calendar}. */ public static class Builder { - /** Sets the {@link Calendar#YEAR} field to the specified value. */ - public Builder setYear (int year) { - return set(Calendar.YEAR, year); - } - /** Adds the specified value to the {@link Calendar#YEAR} field. Use negative values to * subtract. */ public Builder addYears (int years) { return add(Calendar.YEAR, years); } - /** Sets the {@link Calendar#MONTH} field to the specified value. Use {@link - * Calendar#JANUARY} and friends or rue your foolishness. */ - public Builder setMonth (int month) { - return set(Calendar.MONTH, month); - } - /** Adds the specified value to the {@link Calendar#MONTH} field. Use negative values to * subtract. */ public Builder addMonths (int months) { return add(Calendar.MONTH, months); } - /** Sets the {@link Calendar#DATE} field to the specified value. The first day of the month - * has value 1. */ - public Builder setDay (int day) { - return set(Calendar.DATE, day); - } - /** Adds the specified value to the {@link Calendar#DATE} field. Use negative values to * subtract. */ public Builder addDays (int days) { @@ -199,7 +182,8 @@ public class Calendars /** * Returns a fluent wrapper around a calendar configured to Midnight on specified day in the - * specified month and year. + * specified month and year. Note: be sure to use {@link Calendar#JANUARY}, etc. for the month + * argument or be prepared rue your folly. */ public static Builder at (int year, int month, int day) {