{"id":20881957,"url":"https://github.com/firaja/jenerators","last_synced_at":"2025-06-26T11:33:50.921Z","repository":{"id":138120226,"uuid":"128642031","full_name":"firaja/Jenerators","owner":"firaja","description":":electric_plug: A java library for generators","archived":false,"fork":false,"pushed_at":"2020-02-29T11:14:09.000Z","size":375,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T17:18:03.542Z","etag":null,"topics":["generator","java-generator","java-generators","java-library"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firaja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-08T13:05:11.000Z","updated_at":"2020-11-08T20:25:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"5b7ad326-1ade-4f89-a139-53053bf5e284","html_url":"https://github.com/firaja/Jenerators","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/firaja/Jenerators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firaja%2FJenerators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firaja%2FJenerators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firaja%2FJenerators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firaja%2FJenerators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firaja","download_url":"https://codeload.github.com/firaja/Jenerators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firaja%2FJenerators/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262056471,"owners_count":23251678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","java-generator","java-generators","java-library"],"created_at":"2024-11-18T07:28:26.376Z","updated_at":"2025-06-26T11:33:50.901Z","avatar_url":"https://github.com/firaja.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jenerators\n\n[![Build Status](https://travis-ci.org/firaja/java-generators.svg?branch=master)](https://travis-ci.org/firaja/java-generators) \n[![Maintainability](https://api.codeclimate.com/v1/badges/630b3107e8dd859a9d2a/maintainability)](https://codeclimate.com/github/firaja/java-generators/maintainability) \n[![codecov](https://codecov.io/gh/firaja/java-generators/branch/master/graph/badge.svg)](https://codecov.io/gh/firaja/java-generators)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA Java library for building generators.\n\nWith a simple and clear interface, build a generator returning elements on-demand.\n\n## Getting Started\n\nThe following code models the mathematical structure for the first 50 elements\nof the Fibonacci sequence:\n```java\nStatefulGenerator\u003cLong\u003e fibonacci = new MemoryListGenerator\u003cLong\u003e(50) {\n\t@Override\n\tpublic Long generate() {\n\t\tif (c() == 0) {\n\t\t\treturn 1L;\n\t\t} else if (c() == 1) {\n\t\t\treturn 1L;\n\t\t} else {\n\t\t\treturn getResult(c() - 1) + getResult(c() - 2);\n\t\t}\n\t}\n};\n\n```\nAnd then you can just *lazily* retrieve the results like this:\n```java\nfor(Long i : fibonacci){\n\tSystem.out.println(i);\n}\n```\n \u003csup\u003e(the *n*-th element of the Fibonacci sequence is calculated during the *n*-th iteration of the *for* loop)\u003c/sup\u003e\n## Documentation\n\nThe javadoc API can be found in this [page](https://firaja.github.io/java-generators/doc)\n\n\n## Authors\n\n* **David Bertoldi** - *Creator* - [firaja](https://github.com/firaja)\n\nSee also the list of [contributors](https://github.com/firaja/java-generators/graphs/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the Apache-2.0 - see the [LICENSE](LICENSE) file for details\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiraja%2Fjenerators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiraja%2Fjenerators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiraja%2Fjenerators/lists"}