lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] clambertus edited a comment on issue #279: Convert Java Iterator classes to implement IEnumerable<T>
Date Tue, 05 May 2020 17:57:58 GMT

clambertus edited a comment on issue #279:
URL: https://github.com/apache/lucenenet/issues/279#issuecomment-624212396


   <p>GitHub user AndyPook opened a pull request:</p>
   
   <p>    <a href="https://github.com/apache/lucenenet/pull/212" class="external-link"
rel="nofollow">https://github.com/apache/lucenenet/pull/212</a></p>
   
   <p>    <a href="https://issues.apache.org/jira/browse/GH-469" title="Convert Java
Iterator classes to implement IEnumerable<T>" class="issue-link" data-issue-key="GH-469">GH-469</a>
- enumerables</p>
   
   <p>    See <a href="https://issues.apache.org/jira/projects/LUCENENET/issues/GH-469"
class="external-link" rel="nofollow">https://issues.apache.org/jira/projects/LUCENENET/issues/GH-469</a>
for background.</p>
   
   <p>    This is an early stage proposal for implementing IEnumerable<T> on various
"Enum" types. To enable `foreach` and linq style operators.</p>
   
   <p>    This prototype provides `EnumEnumerator<T>` as a helper. It can be used
in various ways to make the implementation of `IEnumerable<T>` more straightforward.</p>
   
   <p>    I have modified `IBytesRefIterator` and `TermsEnum` to add `IEnumerable<BytesRef>`
and therefore to all of it's descendants.</p>
   
   <p>    The test (such as it is) demonstrates retrieving a `TermsEnum` from a reader.
Then using `foreach` and a simple `.Count()` linq operator.</p>
   
   <p>    If this approach is acceptable it ought to be adaptable to other Enum types</p>
   
   <p>You can merge this pull request into a Git repository by running:</p>
   
   <p>    $ git pull <a href="https://github.com/AndyPook/lucenenet" class="external-link"
rel="nofollow">https://github.com/AndyPook/lucenenet</a> <a href="https://issues.apache.org/jira/browse/GH-469"
title="Convert Java Iterator classes to implement IEnumerable<T>" class="issue-link"
data-issue-key="GH-469">GH-469</a></p>
   
   <p>Alternatively you can review and apply these changes as the patch at:</p>
   
   <p>    <a href="https://github.com/apache/lucenenet/pull/212.patch" class="external-link"
rel="nofollow">https://github.com/apache/lucenenet/pull/212.patch</a></p>
   
   <p>To close this pull request, make a commit to your master/trunk branch<br/>
   with (at least) the following in the commit message:</p>
   
   <p>    This closes #212</p>
   
   <hr />
   <p>commit 008df498bcba7e9940ca97efc83d656ddb03b2c3<br/>
   Author: Andy Pook <andy.pook@gmail.com><br/>
   Date:   2017-08-14T21:32:45Z</p>
   
   <p>    simple editorconfig</p>
   
   <p>    ensures spaces for indent</p>
   
   <p>commit 59646be0cf8fbc7e8ad64f395f451a11aca57fc6<br/>
   Author: Andy Pook <andy.pook@gmail.com><br/>
   Date:   2017-08-14T21:34:48Z</p>
   
   <p>    add EnumEnumerator helper</p>
   
   <p>commit 526ddaf8c837f82cd141324e922372155914701b<br/>
   Author: Andy Pook <andy.pook@gmail.com><br/>
   Date:   2017-08-14T21:35:32Z</p>
   
   <p>    add IEnumerable to TermsEnum/IBytesRefArray</p>
   
   <p>commit 456df8e8347ef67055b712722b50cc3b1bbf26cc<br/>
   Author: Andy Pook <andy.pook@gmail.com><br/>
   Date:   2017-08-14T21:36:54Z</p>
   
   <p>    add header, fix usings</p>
   
   <p>commit 1a1c25da7cbcd112d12d6c418c669786cdf4088c<br/>
   Author: Andy Pook <andy.pook@gmail.com><br/>
   Date:   2017-08-14T22:25:15Z</p>
   
   <p>    add example test</p>
   
   <hr />
   <i>by githubbot</i>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message