Hi All,

First, let me introduce myself (I am new to this list, thanks Stephen for
subscribing me). I am the JScience project owner (http://jscience.org) and
currently looking into integrating Joda calendars into JScience
(org.jscience.history.calendars). JScience provides the current JSR-275
baseline for javax.units/javax.quantities which might be of interest to
Joda-Time (e.g. Quantity<Duration>).
With regard to the question below, I believe that JScience measures
modules might be of some help. Hence, the following question: How
Joda-Time and JScience may collaborate/work together in the future. Do you
want to include the measures module to Joda-Time?  How JScience can
integrate Joda calendars? etc...

Any comment and feedback is welcome.

Best regards,
Jean-Marie.


> 'mult' itself doesn't seem to be an intrinsic property of a duration.
> however there may be another abstraction lurking in there which is a
> better fit for the domain. it's not clear from jim's example what that
> is however.
>
> Stephen Colebourne wrote:
>> We don't have any multiplication, division or ratio operations at
>> present. While I can understand the use case below, I'm not sure that it
>> is generic enough to form part of Joda-Time itself. Any other views on
>> this?
>>
>> Stephen
>>
>>
>> Jim Leask wrote:
>>
>>> I am doing some time calculations on Durations that involve ratios -
>>> basically floating point multiplication operations on Durations an
>>> Intervals.
>>>
>>> For example, I have an event with a start/end time (an Interval) and
>>> another event (DateTime) that happened in the middle. I can easily
>>> calculate the Duration of the original event, then from that figure
>>> out the ratio of where the other event happened in the middle.
>>> However, I need to do lots of messing around with millisecond
>>> operations, and converting to/from long and float.
>>>
>>> Is there an easier way? It would help quite a bit if the Duration
>>> class had a 'mult' operator.
>>>
>>> I'd like to be able to do something like the following:
>>>
>>>     Duration durationStartToFinish    = new Duration( startDateTime,
>>> endDateTime );
>>>     Duration durationStartToMiddle    = new Duration (startDateTime,
>>> middleDateTime);
>>>
>>>     float ratio = durationStartToMiddle .divide( durationStartToFinish
>>> );
>>>
>>> then later....
>>>
>>>     Interval otherInterval = new Interval( otherStartDateTime,
>>> otherFinishDateTime );
>>>
>>>     DateTime middleTime = otherInterval.mult( ratio );
>>>
>>> or
>>>     Duration otherDurationFromStart = otherInterval.toDuration().mult
>>> ( ratio );
>>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> that extends applications into web and mobile media. Attend the live
>> webcast
>> and join the prime developer group breaking into this new coding
>> territory!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>> _______________________________________________
>> Joda-interest mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>
>>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Joda-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to