commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Kitching (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-454) Add getCharArray() to CharRange
Date Thu, 07 Aug 2008 15:21:44 GMT

    [ https://issues.apache.org/jira/browse/LANG-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620649#action_12620649
] 

Simon Kitching commented on LANG-454:
-------------------------------------

Interesting. Several languages (ruby,python,perl) do have similar "iterate over range" functionality.


If implemented, it would possibly be better to use the "generator" pattern rather than actually
returning a collection, ie return a custom iterator that knows how to generate the next value
instead of creating a real collection. Sadly due to limitations in java's for-loop, new-style
for loops require a collection object (ie type Iterable) not an iterator though. And probably
c:forEach needs Iterable or Collection too.

Generators or similar do feel more like commons-collections territory than commons-lang though.

> Add getCharArray()  to CharRange
> --------------------------------
>
>                 Key: LANG-454
>                 URL: https://issues.apache.org/jira/browse/LANG-454
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.4
>            Reporter: Kenny MacLeod
>
> org.apache.commons.lang.CharRange would be a lot more useful if it had a means to obtain
the characters in the range as a char array.
> i.e.
> new CharRange('a',''d').toCharArray() == new char[] { 'a', 'b', 'c', 'd' }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message