Stephen Colebourne wrote:

> We have the following operations to define:
> - contains
> - abuts
> - overlaps
> - overlap (the amount of overlap of two intervals)
> - gap (the gap between two intervals)
> 
> a = [08:00,09:00)
> b = [09:00,09:00)
> c = [09:00,10:00)
> 
> One option is to define an empty interval as returning false to the 
> first three and null to the last two:
> - a abuts c
> - neither a or c abut or contain b
> But what does the interval start/end datetime represent in this case?
> 
> A second non-maths option is to make the empty interval lie between two 
> real intervals:
> - a, b and c all abut each other at 09:00
> - neither a nor c contains b
> 
> A third option is to define the empty interval as a point on the 
> timeline at 09:00 that is therefore contained in c:
> - a, b and c all abut each other at 09:00
> - c contains b, thus b and c overlap

Another option is that contains, abuts, overlaps return the empty set, 
the "amount of overlap" is either 0 ms or an empty interval (I don't 
know the data type of the result). As for the gap, I imagine that would 
have to either throw an exception or be NaN ms or be MAX_LONG ms. I 
would imagine 'null' to be the worst possible answer.
-- 
J. B. (Joe) Rainsberger :: http://www.jbrains.info
Your guide to software craftsmanship
JUnit Recipes: Practical Methods for Programmer Testing
2005 Gordon Pask Award for contribution Agile Software Practice

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to