commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Rucker Jones (JIRA)" <>
Subject [jira] [Created] (LANG-1376) Iterable classes derived from Range for incremental types
Date Sat, 20 Jan 2018 21:29:00 GMT
Andrew Rucker Jones created LANG-1376:

             Summary: Iterable classes derived from Range for incremental types
                 Key: LANG-1376
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.*
    Affects Versions: 3.7
            Reporter: Andrew Rucker Jones

I have a use case for deriving a class from Range with Integer as its parameter and iterating
over all integers in the range. In fact, in my use case I have a List<Range<Integer>>,
and would love to combine them easily using Commons Collection's LazyIteratorChain to iterate
over all integers in all of the fields. I can't do this because Range is declared final, so
I wrote my own Iterator in a wrapping class. It seems to me, though, that I might not be the
only one who would think it useful to iterate over a Range as long as the Range is a type
that can be incremented.

Perhaps one could derive classes like IntegerRange, ShortRange, and LongRange and possibly
even BigDecimalRange that implement Iterable.

If the project is interested in my suggestion, I would be willing to submit a patch.

This message was sent by Atlassian JIRA

View raw message