← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14997: more javadocs for Calendar/DateUnit/DateInterval/CalendarService

 

------------------------------------------------------------
revno: 14997
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-04-26 12:14:49 +0545
message:
  more javadocs for Calendar/DateUnit/DateInterval/CalendarService
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java	2014-04-26 06:11:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java	2014-04-26 06:29:49 +0000
@@ -79,7 +79,7 @@
     DateUnit fromIso( DateUnit dateUnit );
 
     /**
-     * Returns this local year as a ISO 8601 interval
+     * Gets this local year as a ISO 8601 interval
      * @param year Local year
      * @return ISO 8601 interval for year
      * @see <a href="http://en.wikipedia.org/wiki/ISO_8601";>http://en.wikipedia.org/wiki/ISO_8601</a>
@@ -87,7 +87,7 @@
     DateInterval toIsoInterval( int year );
 
     /**
-     * Returns this local year/month as a ISO 8601 interval
+     * Gets this local year/month as a ISO 8601 interval
      * @param year  Local year
      * @param month Local month
      * @return ISO 8601 interval for year/month
@@ -96,37 +96,37 @@
     DateInterval toIsoInterval( int year, int month );
 
     /**
-     * Returns current date as local DateUnit
+     * Gets current date as local DateUnit
      * @return Today date as local DateUnit
      */
     DateUnit today();
 
     /**
-     * Returns the number of months in a calendar year.
+     * Gets the number of months in a calendar year.
      * @return Number of months in a year
      */
     int monthsInYear();
 
     /**
-     * Returns the number of days in a calendar week.
+     * Gets the number of days in a calendar week.
      * @return Number of days in a week
      */
     int daysInWeek();
 
     /**
-     * Returns the number of days in a calendar year.
+     * Gets the number of days in a calendar year.
      * @return Number of days in this calendar year
      */
     int daysInYear( int year );
 
     /**
-     * Returns the number of days in a calendar year/month.
+     * Gets the number of days in a calendar year/month.
      * @return Number of days in this calendar year/month
      */
     int daysInMonth( int year, int month );
 
     /**
-     * Returns week number using local DateUnit, week number is calculated based on
+     * Gets week number using local DateUnit, week number is calculated based on
      * ISO 8601 week numbers
      * @param dateUnit DateUnit representing local year, month, day
      * @return Week number
@@ -143,7 +143,7 @@
     int week( DateUnit dateUnit );
 
     /**
-     * Returns the ISO 8601 weekday for this local DateUnit, using ISO 8601 day numbering,
+     * Gets the ISO 8601 weekday for this local DateUnit, using ISO 8601 day numbering,
      * 1=Monday => 7=Sunday.
      * @param dateUnit DateUnit representing local year, month, day
      * @return Weekday number
@@ -153,10 +153,12 @@
     int isoWeekday( DateUnit dateUnit );
 
     /**
-     * Returns the local weekday for this local DateUnit, using ISO 8601 day numbering,
+     * Gets the local weekday for this local DateUnit, using ISO 8601 day numbering,
      * 1=Monday => 7=Sunday.
      * @param dateUnit DateUnit representing local year, month, day
      * @return Weekday number
+     * @see <a href="http://en.wikipedia.org/wiki/ISO_8601";>http://en.wikipedia.org/wiki/ISO_8601</a>
+     * @see <a href="http://en.wikipedia.org/wiki/ISO_week_date";>http://en.wikipedia.org/wiki/ISO_week_date</a>
      */
     int weekday( DateUnit dateUnit );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java	2014-04-25 13:14:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/CalendarService.java	2014-04-26 06:29:49 +0000
@@ -31,11 +31,21 @@
 import java.util.List;
 
 /**
+ * Simple service for returning all available calendars, and also giving the current system calendar.
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ * @see Calendar
  */
 public interface CalendarService
 {
+    /**
+     * Gets all available calendars as a sorted list.
+     * @return All available calendars
+     */
     List<Calendar> getAll();
 
+    /**
+     * Gets the currently selected system calendar.
+     * @return System calendar
+     */
     Calendar getSystemCalendar();
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java	2014-04-25 06:29:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java	2014-04-26 06:29:49 +0000
@@ -28,13 +28,26 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import javax.validation.constraints.NotNull;
+
 /**
+ * Class representing a date interval.
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ * @see DateUnit
+ * @see Calendar
  */
 public class DateInterval
 {
+    /**
+     * Start of interval. Required.
+     */
+    @NotNull
     private final DateUnit from;
 
+    /**
+     * End of interval. Required.
+     */
+    @NotNull
     private final DateUnit to;
 
     public DateInterval( DateUnit from, DateUnit to )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java	2014-04-24 16:21:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateUnit.java	2014-04-26 06:29:49 +0000
@@ -32,17 +32,37 @@
 import org.joda.time.DateTime;
 import org.joda.time.chrono.ISOChronology;
 
+import javax.validation.constraints.NotNull;
+
 /**
+ * Class representing a specific calendar date.
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ * @see DateInterval
+ * @see Calendar
  */
 public class DateUnit
 {
+    /**
+     * Year of date. Required.
+     */
+    @NotNull
     int year;
 
+    /**
+     * Month of date. Required.
+     */
+    @NotNull
     int month;
 
+    /**
+     * Day of date. Required.
+     */
+    @NotNull
     int day;
 
+    /**
+     * Day of week, numbering is unspecified and left up to user.
+     */
     int dayOfWeek;
 
     public DateUnit()