jsr-310
  1. jsr-310
  2. JSR_310-3

Make java.xtime.Duration more user-friendly

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: code
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      3

      Description

      When browsing the jsr-310 API doc, I stumbled upon the Duration class which
      struck me as rather sub-optimal:
      Why ist there no unit assigned to a Duration?
      Why is it restricted to holding a 'seconds' value and a fractional part
      expressed in 'nanoseconds'?
      Why can't you add/subtract Durations with arbitrary precisions to/from each other?

      Or, to sum it up: why isn't it as elegantly designed as this Duration class:

      http://www.neppert.com/duration/doc/index.html

      OK, I'm prejudiced because I wrote that one

      But it really has some distinctive features:

      • integrates seamlessly with java.util.concurrent.*
      • represents a Duration as a number plus a unit plus an optional fractional part
        that is Duration itself.
      • allows lossless transformations between Durations with different units.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jsr-310-issues
            Reporter:
            mcnepp
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: