Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUCENENET-469 - enumerables #212

Open
wants to merge 6 commits into
base: master
from

Conversation

@AndyPook
Copy link

commented Aug 14, 2017

See https://issues.apache.org/jira/projects/LUCENENET/issues/LUCENENET-469 for background.

This is an early stage proposal for implementing IEnumerable on various "Enum" types. To enable foreach and linq style operators.

This prototype provides EnumEnumerator<T> as a helper. It can be used in various ways to make the implementation of IEnumerable<T> more straightforward.

I have modified IBytesRefIterator and TermsEnum to add IEnumerable<BytesRef> and therefore to all of it's descendants.

The test (such as it is) demonstrates retrieving a TermsEnum from a reader. Then using foreach and a simple .Count() linq operator.

If this approach is acceptable it ought to be adaptable to other Enum types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.