[
https://issues.apache.org/jira/browse/GROOVY-2839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-2839:
--------------------------------
Fix Version/s: (was: 4.x)
> Provide a find or findAll interface that take a parameter to limit the number
> of result, similar to the SQL LIMIT keyword
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-2839
> URL: https://issues.apache.org/jira/browse/GROOVY-2839
> Project: Groovy
> Issue Type: New Feature
> Components: syntax
> Affects Versions: 1.5.6, 1.6-beta-1
> Reporter: Mingfai Ma
> Priority: Major
>
> Currently, the find() method return the first matched result, findAll()
> returns all matched result. It's suggested to have an interface that take a
> "limit" parameter to limit the maximum number of return records.
> - find() (or findAll()) to take a "limit" integer to decide how many records
> shall be returned.
> e.g. [1,2,3,4].findAll(2){it>1} == [2,3]
> - Groovy 1.x doesn't support "break" in the closure.
> Also refer to the discussion at:
> http://www.nabble.com/Groovy-syntax--API-enhancement-td16796998.html#a16810531
--
This message was sent by Atlassian Jira
(v8.20.1#820001)