{"id":21257557,"url":"https://github.com/ventralnet/collections-extra","last_synced_at":"2025-09-17T09:53:31.128Z","repository":{"id":13861785,"uuid":"16559568","full_name":"ventralnet/collections-extra","owner":"ventralnet","description":"Collections and collections utilities I have written","archived":false,"fork":false,"pushed_at":"2014-02-27T11:35:01.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-16T13:09:37.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"cerebral/cerebral","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ventralnet.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}},"created_at":"2014-02-05T21:45:12.000Z","updated_at":"2014-02-27T11:35:00.000Z","dependencies_parsed_at":"2022-08-28T16:03:54.496Z","dependency_job_id":null,"html_url":"https://github.com/ventralnet/collections-extra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ventralnet/collections-extra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ventralnet%2Fcollections-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ventralnet%2Fcollections-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ventralnet%2Fcollections-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ventralnet%2Fcollections-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ventralnet","download_url":"https://codeload.github.com/ventralnet/collections-extra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ventralnet%2Fcollections-extra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275573377,"owners_count":25489094,"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-09-17T02:00:09.119Z","response_time":84,"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":[],"created_at":"2024-11-21T04:04:23.428Z","updated_at":"2025-09-17T09:53:31.107Z","avatar_url":"https://github.com/ventralnet.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"collections-extra\n===================\n\nCollections and collections utilities I have written\n\nDefaultValueMap\n---------------\n\nDefaultValueMap is a class that extends java.util.HashMap that, when a key does not exist\nwill return a default value that is provided during construction through a DefaultValueCreator.\n\nFor example\n```java\n  DefaultValueCreator\u003cLong\u003e zeroLongCreator = new DefaultValueCreator\u003cLong\u003e() {\n    public Long create() {\n      return 0L;\n    }\n  };\n  DefaultValueMap\u003cString, Long\u003e defaultToZeroMap = new DefaultValueMap\u003cString, Long\u003e(zeroLongCreator);\n  \n  assertEquals((Long)0L,defaultToZeroMap.get(\"key_that_does_not_exist\"));\n```\n\nCountMap\n--------\n\nCountMap is a subclass of DefaultValueMap which uses the default value of 0L. CountMap provides a\nmethod .add(K key, Long addend) that will add the addend to the value specified at key.\n\nFor example\n```java\n  CountMap\u003cString\u003e countMap = new CountMap\u003cString\u003e();\n  \n  assertEquals((Long)0L, countMap.get(\"key_does_not_exist\"));\n  countMap.add(\"key_does_not_exist\",100L);\n  assertEquals((Long)100L,countMap.get(\"key_does_not_exist\"));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fventralnet%2Fcollections-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fventralnet%2Fcollections-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fventralnet%2Fcollections-extra/lists"}