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

Thomas Neidhart edited comment on COLLECTIONS-366 at 3/3/13 7:22 PM:
---------------------------------------------------------------------

Well, the loop example is maybe not the most convincing one.

The Range class in commons-lang does not allow to use it with a collection API, 
this is the main use I see for this feature.
You can convert a Range to an array, but this means you have to create all 
elements in advance, which may be large in some cases.

Actually it is very similar to a LazyList decorator, with the difference that 
is has a fixed size (a LazyList decorator allows the underlying list to grow), 
and does not store the created elements, but only creates and returns them when 
needed.

If people argue that this is quite a useless feature, I am fine with removing 
it again, so please comment.
                
      was (Author: tn):
    Well, the loop example is maybe not the most convincing one.

The Range class in commons-lang does not allow to use it with a collection API, 
this is the main use I see for this feature.
You can convert a Range to an array, but this means you have to create all 
elements in advance, which may be large in some cases.

Actually it is very similar to a LazyList decorator, with the different that is 
has a fixed size (a LazyList decorator allows the underlying list to grow), and 
does not store the created elements, but only creates and returns them when 
needed.

If people argue that this is quite a useless feature, I am fine with removing 
it again, so please comment.
                  
> 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