{"id":30138299,"url":"https://github.com/nodef/extra-boolean.java","last_synced_at":"2025-10-24T00:27:02.465Z","repository":{"id":57733628,"uuid":"330831430","full_name":"nodef/extra-boolean.java","owner":"nodef","description":"Boolean data type has two possible truth values to represent logic.","archived":false,"fork":false,"pushed_at":"2025-04-10T20:05:36.000Z","size":602,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T21:06:57.465Z","etag":null,"topics":["algebra","boolean","eqv","extra","imp","logic","parse","xor"],"latest_commit_sha":null,"homepage":"https://search.maven.org/artifact/io.github.javaf/extra-boolean","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodef.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,"zenodo":null}},"created_at":"2021-01-19T01:34:21.000Z","updated_at":"2025-04-10T20:05:39.000Z","dependencies_parsed_at":"2025-04-10T21:21:19.193Z","dependency_job_id":"5c6dd210-5873-4ec8-ae83-8d048ed56043","html_url":"https://github.com/nodef/extra-boolean.java","commit_stats":null,"previous_names":["nodef/extra-boolean.java","javaf/extra-boolean"],"tags_count":0,"template":false,"template_full_name":"moocf/hello-world.java","purl":"pkg:github/nodef/extra-boolean.java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodef","download_url":"https://codeload.github.com/nodef/extra-boolean.java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodef%2Fextra-boolean.java/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269814802,"owners_count":24479448,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algebra","boolean","eqv","extra","imp","logic","parse","xor"],"created_at":"2025-08-11T01:06:09.728Z","updated_at":"2025-10-24T00:26:57.429Z","avatar_url":"https://github.com/nodef.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Boolean data type has two possible truth values to represent logic.\u003cbr\u003e\n:package: [Central](https://search.maven.org/artifact/io.github.javaf/extra-boolean),\n:scroll: [Releases](https://repo1.maven.org/maven2/io/github/javaf/extra-boolean/),\n:smiley_cat: [GitHub](https://github.com/javaf/hello-world/packages/579834),\n:frog: [Bintray](https://bintray.com/beta/#/bintray/jcenter/io.github.javaf:extra-boolean),\n:peacock: [MvnRepository](https://mvnrepository.com/artifact/io.github.javaf/extra-boolean),\n:newspaper: [Javadoc](https://javaf.github.io/extra-boolean/),\n:blue_book: [Wiki](https://github.com/javaf/extra-boolean/wiki).\n\nHere is my implementation of digital logic gates in software. That includes\nthe basic gates [not], [and], [or], [xor]; their complements [nand], [nor],\n[xnor]; and 2 propositional logic (taught in discrete mathematics) gates\n[imply], [eq]; and their complements [nimply], [neq]. There is also a\nmultiplexer, called [select], and a `true` counter, called [count]. [count]\ncan help you make custom gates, such as an *alternate* concept of **xnor**\nwhich returns `true` only if all inputs are the same (standard [xnor] returns\n`true` if even inputs are `true`). All of them can handle upto 8 inputs.\n\n[parse] is influenced by [boolean] package, and is quite good at translating\n`string` to `boolean`. It can also handle double negatives, eg. `not inactive`.\nYou know the [and] of 2-inputs, but what of 1-input? What of 0? And what of\nthe other gates? I answer them here.\n\n\u003e Stability: Experimental.\n\n\u003cbr\u003e\n\n```java\nimport io.github.javaf.*;\n\nBoolean.parse(\"1\");\nBoolean.parse(\"not off\");\nBoolean.parse(\"truthy\");\n// true\n\nBoolean.parse(\"not true\");\nBoolean.parse(\"inactive\");\nBoolean.parse(\"disabled\");\n// false\n\nBoolean.imply(true, false);\n// false\n\nBoolean.eq(false, false);\n// true\n\nBoolean.xor(true, true, true);\n// true\n\nBoolean.select(1, true, false, true);\n// false                  ^\n\nBoolean.count(true, false, true);\n// 2           ^            ^\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## Index\n\n| Method   | Action                                |\n| -------- | ------------------------------------- |\n| [parse]  | Converts string to boolean.            |\n| [not]    | Checks if value is false.              |\n| [and]    | Checks if all values are true.         |\n| [or]     | Checks if any value is true.           |\n| [xor]    | Checks if odd no. of values are true.  |\n| [nand]   | Checks if any value is false.          |\n| [nor]    | Checks if all values are false.        |\n| [xnor]   | Checks if even no. of values are true. |\n| [eq]     | Checks if antecedent ⇔ consequent.     |\n| [neq]    | Checks if antecedent ⇎ consequent.     |\n| [imply]  | Checks if antecedent ⇒ consequent.     |\n| [nimply] | Checks if antecedent ⇏ consequent.     |\n| [select] | Checks if ith value is true.           |\n| [count]  | Counts no. of true values.             |\n\n[boolean]: https://www.npmjs.com/package/boolean\n[parse]: https://github.com/javaf/extra-boolean/wiki/parse\n[not]: https://github.com/javaf/extra-boolean/wiki/not\n[and]: https://github.com/javaf/extra-boolean/wiki/and\n[or]: https://github.com/javaf/extra-boolean/wiki/or\n[xor]: https://github.com/javaf/extra-boolean/wiki/xor\n[nand]: https://github.com/javaf/extra-boolean/wiki/nand\n[nor]: https://github.com/javaf/extra-boolean/wiki/nor\n[xnor]: https://github.com/javaf/extra-boolean/wiki/xnor\n[eq]: https://github.com/javaf/extra-boolean/wiki/eq\n[neq]: https://github.com/javaf/extra-boolean/wiki/neq\n[imply]: https://github.com/javaf/extra-boolean/wiki/imply\n[nimply]: https://github.com/javaf/extra-boolean/wiki/nimply\n[select]: https://github.com/javaf/extra-boolean/wiki/select\n[count]: https://github.com/javaf/extra-boolean/wiki/count\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n[![](https://img.youtube.com/vi/6mMK6iSZsAs/maxresdefault.jpg)](https://www.youtube.com/watch?v=6mMK6iSZsAs)\n\n![](https://ga-beacon.deno.dev/G-G1E8HNDZYY:v51jklKGTLmC3LAZ4rJbIQ/github.com/javaf/extra-boolean)\n![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/extra-boolean.java)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-boolean.java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodef%2Fextra-boolean.java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodef%2Fextra-boolean.java/lists"}