[ 
https://issues.apache.org/jira/browse/COLLECTIONS-366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13591450#comment-13591450
 ] 

Thomas Neidhart commented on COLLECTIONS-366:
---------------------------------------------

Adding this new RangeList as a normal class in the list package would not fit 
imho.
But it would be a nice addition to ListUtils:

{noformat}
    public static List<Integer> range(final int from, final int to) {
        return ListUtils.unmodifiableList(new RangeList(from, to));
    }
{noformat}

The actual RangeList implementation will be an inner class of ListUtils and 
greatly reduced in size by extending AbstractList. Thus only a few methods need 
to be overwritten. By wrapping it with an UnmodifiableList we are sure it can 
not be modified.
                
> A light-weighted list of integers
> ---------------------------------
>
>                 Key: COLLECTIONS-366
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-366
>             Project: Commons Collections
>          Issue Type: New Feature
>    Affects Versions: 3.2
>            Reporter: Dmitry Katsubo
>         Attachments: RangeList_fixed1.zip
>
>
> Sometimes there is a demand too have a list, that represents numbers within 
> some range (say, [5..10]). If the range is big (millions of records), 
> creating a dummy list that holds all instances of objects is too expensive.
> The provided implementation (attached to this issue) solves this problem. 
> Nice to have in commons collections.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to