The Source for Java Technology Collaboration


JSR 310 Date and Time - Choice - Calendar field names

Calendar fields (such as day of week and hour of day) have names.

There are two basic naming strategies:

Option 1 - Consistent

The consistent option names fields using 'of' in the middle, like unitOfRange.

  • SecondOfMinute
  • MinuteOfHour
  • MinuteOfDay
  • HourOfDay
  • HourOfMeridiem
  • DayOfWeek
  • DayOfMonth
  • DayOfYear
  • MonthOfYear
  • Year - no 'Of' as year is unbound

Option 2 - Focussed

The focussed option names fields using just the unit for all the common cases, unless there is ambiguity as to the common case. All other fields are named as per option 1.

  • Second
  • Minute
  • MinuteOfDay
  • Hour
  • HourOfMeridiem
  • DayOfWeek
  • DayOfMonth
  • DayOfYear
  • Month
  • Year


Topic DateTimeCalendarFieldNames . { Edit | Ref-By | Printable | Diffs r2 < r1 | More }
 XML java.net RSS

Revision r2 - 12 Nov 2007 - 18:19:55 - Main.scolebourne
Parents: WebHome > DateTimeAPI > DateTimeScope > DateTimeChoices