|
From: <ma...@us...> - 2006-09-02 14:00:08
|
Revision: 79
http://svn.sourceforge.net/objectlabkit/?rev=79&view=rev
Author: marchy
Date: 2006-09-02 06:59:52 -0700 (Sat, 02 Sep 2006)
Log Message:
-----------
renamed DefaultPeriodCountCalculator to DateCountCalculator, and make it delegate to the calendar implementation
Modified Paths:
--------------
trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultDateCalculatorFactory.java
Added Paths:
-----------
trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DatePeriodCountCalculator.java
Removed Paths:
-------------
trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultPeriodCountCalculator.java
Copied: trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DatePeriodCountCalculator.java (from rev 74, trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultPeriodCountCalculator.java)
===================================================================
--- trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DatePeriodCountCalculator.java (rev 0)
+++ trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DatePeriodCountCalculator.java 2006-09-02 13:59:52 UTC (rev 79)
@@ -0,0 +1,49 @@
+/*
+ * $Id$
+ *
+ * Copyright 2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package net.objectlab.kit.datecalc.jdk;
+
+import java.util.Date;
+
+import net.objectlab.kit.datecalc.common.PeriodCountBasis;
+import net.objectlab.kit.datecalc.common.PeriodCountCalculator;
+
+/**
+ * TODO javadoc
+ *
+ * @author Marcin Jekot
+ * @author $LastChangedBy$
+ * @version $Revision$ $Date$
+ *
+ */
+public class DatePeriodCountCalculator implements PeriodCountCalculator<Date> {
+
+ private final CalendarPeriodCountCalculator PCC = new CalendarPeriodCountCalculator();
+
+ public int dayDiff(final Date start, final Date end, final PeriodCountBasis basis) {
+
+ return PCC.dayDiff(Utils.getCal(start), Utils.getCal(end), basis);
+ }
+
+ public double monthDiff(final Date start, final Date end, final PeriodCountBasis basis) {
+ return PCC.monthDiff(Utils.getCal(start), Utils.getCal(end), basis);
+ }
+
+ public double yearDiff(final Date start, final Date end, final PeriodCountBasis basis) {
+ return PCC.yearDiff(Utils.getCal(start), Utils.getCal(end), basis);
+ }
+}
Modified: trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultDateCalculatorFactory.java
===================================================================
--- trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultDateCalculatorFactory.java 2006-09-02 10:04:07 UTC (rev 78)
+++ trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultDateCalculatorFactory.java 2006-09-02 13:59:52 UTC (rev 79)
@@ -38,7 +38,7 @@
private static final DateCalculatorFactory<Date> DEFAULT = new DefaultDateCalculatorFactory();
- private static final PeriodCountCalculator<Date> PCC = new DefaultPeriodCountCalculator();
+ private static final PeriodCountCalculator<Date> PCC = new DatePeriodCountCalculator();
public static DateCalculatorFactory<Date> getDefaultInstance() {
return DEFAULT;
Deleted: trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultPeriodCountCalculator.java
===================================================================
--- trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultPeriodCountCalculator.java 2006-09-02 10:04:07 UTC (rev 78)
+++ trunk/datecalc-jdk/src/main/java/net/objectlab/kit/datecalc/jdk/DefaultPeriodCountCalculator.java 2006-09-02 13:59:52 UTC (rev 79)
@@ -1,46 +0,0 @@
-/*
- * $Id$
- *
- * Copyright 2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package net.objectlab.kit.datecalc.jdk;
-
-import java.util.Date;
-
-import net.objectlab.kit.datecalc.common.PeriodCountBasis;
-import net.objectlab.kit.datecalc.common.PeriodCountCalculator;
-
-/**
- * TODO javadoc
- *
- * @author Benoit Xhenseval
- * @author $LastChangedBy$
- * @version $Revision$ $Date$
- *
- */
-public class DefaultPeriodCountCalculator implements PeriodCountCalculator<Date> {
-
- public int dayDiff(final Date start, final Date end, final PeriodCountBasis basis) {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public double monthDiff(final Date start, final Date end, final PeriodCountBasis basis) {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public double yearDiff(final Date start, final Date end, final PeriodCountBasis basis) {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|