https://github.com/szhu/pythonstyleiterator
https://github.com/szhu/pythonstyleiterator
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/szhu/pythonstyleiterator
- Owner: szhu
- Created: 2015-04-22T04:32:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-22T04:33:43.000Z (about 10 years ago)
- Last Synced: 2025-01-11T23:26:07.483Z (6 months ago)
- Language: Java
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PythonStyleIterator
===================Does this sound like you?
- You like iterators, but...
- You don't want to write a separate `hasNext()` method because it would involve caching.
- You want to peek at iterator outputs.
- You really Python's iterator interface.If so, try out `PythonStyleIterator`! Simply subclass it, and fill in the constructor (if you so desire) and the `tryNext` method. Feel free to call `setCache` and `stopIteration` to affect the iterator at any time.