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

UnmodifiableIterable #114

Closed
yegor256 opened this issue Jun 13, 2017 · 2 comments
Closed

UnmodifiableIterable #114

yegor256 opened this issue Jun 13, 2017 · 2 comments

Comments

@yegor256
Copy link
Owner

Let's introduce UnmodifiableIterable which wraps another iterable and throws if remove() is called.

@Timmeey
Copy link
Contributor

Timmeey commented Jun 13, 2017

@yegor256 so i i had an UnmodifieableIterable i would assume that every call to iterator() would lead to the same sequence of elements. BUt how would you guarantee that behaviour?

If i take a Collection (which implements iterable) and wrap this collection in the UnmodifiableInterable, changes to the underlying Collection would still result in a change in the Iterable, after the next .iterator() call.

I can imagine UnmodifiableIterator since an iterator is inherently unmodifiable if it has his remove() method removed. I already had that problem with the IterableAsList #105 when the underlying iterable changes

yegor256 added a commit that referenced this issue Jun 21, 2017
@yegor256
Copy link
Owner Author

@Timmeey it's fixed, see 3f42592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants