Interpolatable's contract should be reexamined

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • jfx24
    • Affects Version/s: jfx13
    • Component/s: javafx
    • None
    • b12

       javafx.animation.Interpolatable does not specify:

      1. If the returned object is always a new one or if it can be an existing one, as is done with 'if t<=0 return this'.
      2. What happens with double values that are out of the [0, 1] range.

      I suggest that 1 is defined in the implementing class docs because it depends on the mutability of the class, the cost to create a new one etc. Interpolatable can mention that the decision on what to return is class-specific.

      As for 2, it's possible to either clamp the values to [0, 1], or throw an IllegalArgumentException. However, because double values are not exact, it's risky to throw an exception on t<0. Maybe a safety delta is needed.

            Assignee:
            Michael Strauß
            Reporter:
            Nir Lisker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: