|
From: <be...@us...> - 2006-09-06 09:58:24
|
Revision: 118
http://svn.sourceforge.net/objectlabkit/?rev=118&view=rev
Author: benoitx
Date: 2006-09-06 02:58:04 -0700 (Wed, 06 Sep 2006)
Log Message:
-----------
Add doco (package) and clarify some use on home page.
Modified Paths:
--------------
trunk/datecalc-common/src/test/java/net/objectlab/kit/datecalc/common/UtilsTest.java
trunk/datecalc-joda/src/test/java/net/objectlab/kit/datecalc/joda/YearMonthDayIMMDateTest.java
trunk/src/site/index.xml
Added Paths:
-----------
trunk/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/package.html
trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/package.html
Added: trunk/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/package.html
===================================================================
--- trunk/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/package.html (rev 0)
+++ trunk/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/package.html 2006-09-06 09:58:04 UTC (rev 118)
@@ -0,0 +1,6 @@
+<html>
+<body>
+<p>This package provides functionalities that are used by both JDK and Joda implementation,
+it is not released alone but included in the datecalc-jdk or datecalc-joda JARs.</p>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/datecalc-common/src/test/java/net/objectlab/kit/datecalc/common/UtilsTest.java
===================================================================
--- trunk/datecalc-common/src/test/java/net/objectlab/kit/datecalc/common/UtilsTest.java 2006-09-05 23:24:58 UTC (rev 117)
+++ trunk/datecalc-common/src/test/java/net/objectlab/kit/datecalc/common/UtilsTest.java 2006-09-06 09:58:04 UTC (rev 118)
@@ -13,15 +13,12 @@
import junit.framework.TestCase;
public class UtilsTest extends TestCase {
+ private SimpleDateFormat sdf;
- SimpleDateFormat sdf;
+ private Set<Calendar> calendarSet;
- Calendar cal;
+ private Set<Date> dateSet;
- Set<Calendar> calendarSet;
-
- Set<Date> dateSet;
-
@Override
protected void setUp() throws Exception {
sdf = new SimpleDateFormat("yyyy-MM-dd");
Added: trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/package.html
===================================================================
--- trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/package.html (rev 0)
+++ trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/package.html 2006-09-06 09:58:04 UTC (rev 118)
@@ -0,0 +1,6 @@
+<html>
+<body>
+<p>This package provides a pure JDK implementation of the DateCalculator for both Calendar and Date, it is
+released as a standalone datecalc-jdk JAR.</p>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/datecalc-joda/src/test/java/net/objectlab/kit/datecalc/joda/YearMonthDayIMMDateTest.java
===================================================================
--- trunk/datecalc-joda/src/test/java/net/objectlab/kit/datecalc/joda/YearMonthDayIMMDateTest.java 2006-09-05 23:24:58 UTC (rev 117)
+++ trunk/datecalc-joda/src/test/java/net/objectlab/kit/datecalc/joda/YearMonthDayIMMDateTest.java 2006-09-06 09:58:04 UTC (rev 118)
@@ -4,7 +4,6 @@
import net.objectlab.kit.datecalc.common.DateCalculator;
import net.objectlab.kit.datecalc.common.HolidayHandlerType;
-import org.joda.time.LocalDate;
import org.joda.time.YearMonthDay;
public class YearMonthDayIMMDateTest extends AbstractIMMDateTest<YearMonthDay> {
Modified: trunk/src/site/index.xml
===================================================================
--- trunk/src/site/index.xml 2006-09-05 23:24:58 UTC (rev 117)
+++ trunk/src/site/index.xml 2006-09-06 09:58:04 UTC (rev 118)
@@ -79,22 +79,26 @@
should get its own!</li>
<li>when you get a DateCalculator, you can set the startDate, this sets the currentDate too. The startDate does not move. The current date is
the result of your calculations. If the startDate is a non-working day, it may be moved automatically according to the HolidayHandler.</li>
- <li>when you call addDays(..), moveByBusinessDays(..) the currentDate is moved in the Calculator.</li>
+ <li>when you call moveByDays(..), moveByBusinessDays(..) the currentDate is moved in the Calculator.</li>
</ul>
<pre>
// create or get the Holidays
final Set<LocalDate> holidays = new HashSet<LocalDate>();
holidays.add(new LocalDate("2006-08-28"));
+ // register the holidays (any calculator with name "UK" asked from now on will receive a reference to this set
DefaultDateCalculatorFactory.getDefaultInstance().registerHolidays("UK", holidays);
+ // ask for a LocalDate calculator for "UK" (even if a new set of holidays is registered, this one calculator is not affected
DateCalculator<LocalDate> cal = DefaultLocalDateCalculatorFactory.getDefaultInstance().getDateCalculator("UK", HolidayHandlerType.FORWARD);
cal.setStartDate(new LocalDate("2006-08-28)); // this also sets the current business date.
// the startDate stays 28 Aug 06 BUT the currentDate has moved,
// according to Forward handler to 29 Aug 2006.
- cal.getStartDate(); // 28 Aug 06
- cal.getCurrentBusinessDate(); // 29 Aug 06
+ LocalDate start = cal.getStartDate(); // 28 Aug 06
+ LocalDate current = cal.getCurrentBusinessDate(); // 29 Aug 06
+
+ LocalDate newCurrent = cal.moveByDays(4).getCurrentBusinessDate(); // 4 Sept 06 due to weekend!
</pre>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|