Does an open-ended interval implementation exist for Java?

后端 未结 3 577
轻奢々
轻奢々 2020-12-11 06:22

I\'ve got a classification of certain values in different intervals. Most have the form [20-30], but some are of the form [30-infinite).

Is there an interval class y

相关标签:
3条回答
  • 2020-12-11 06:55

    Time&Money project seems to have Interval class that you need.

    See these files in their svn: interval package.

    0 讨论(0)
  • 2020-12-11 07:10

    The Apache-commons-lang project (http://commons.apache.org/lang/) contains classes dealing with ranges (like IntRange - https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/math/IntRange.html). I'm not sure it covers all your needs, but it might be worth checking.

    0 讨论(0)
  • 2020-12-11 07:19

    I know of no library classes, but I recall rather trivially writing such classes.

    0 讨论(0)
提交回复
热议问题