I've written a small Scala library for doing things with interval sets - that is, sets that are defined in terms of the ranges of values they enclose, e.g.
closed(0) to closed(5) // [1...5]
closed(today) to open(nextFriday) // today to next Friday, not inclusive
unbounded[Double] to open(0.0) // all non-zero negative Doubles
The functionality is similar to that of Guava's Ranges, except that non-continuous intervals are also supported, e.g.
(closed(0) to closed(5)) union (closed(10) to closed(15)) // [1...5] U [10...15]
(closed(0) to closed(15)) complement (open(5) to open(10)) // [1...5] U [10...15]
Dominic