{"id":16306186,"url":"https://github.com/gfx/java-weakidentityhashmap","last_synced_at":"2025-10-25T14:30:53.063Z","repository":{"id":17427817,"uuid":"20201014","full_name":"gfx/Java-WeakIdentityHashMap","owner":"gfx","description":"A standalone library for WeakIdentityHashMap to implement inside-out fields","archived":false,"fork":false,"pushed_at":"2014-07-05T07:26:13.000Z","size":332,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T18:21:50.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gfx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-26T23:29:56.000Z","updated_at":"2023-07-07T17:55:23.000Z","dependencies_parsed_at":"2022-09-24T16:22:59.751Z","dependency_job_id":null,"html_url":"https://github.com/gfx/Java-WeakIdentityHashMap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2FJava-WeakIdentityHashMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2FJava-WeakIdentityHashMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2FJava-WeakIdentityHashMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2FJava-WeakIdentityHashMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfx","download_url":"https://codeload.github.com/gfx/Java-WeakIdentityHashMap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238155504,"owners_count":19425727,"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":[],"created_at":"2024-10-10T21:09:53.979Z","updated_at":"2025-10-25T14:30:47.806Z","avatar_url":"https://github.com/gfx.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeakIdentityHashMap [![Build Status](https://travis-ci.org/gfx/Java-WeakIdentityHashMap.svg?branch=master)](https://travis-ci.org/gfx/Java-WeakIdentityHashMap) [![Coverage Status](https://coveralls.io/repos/gfx/Java-WeakIdentityHashMap/badge.png)](https://coveralls.io/r/gfx/Java-WeakIdentityHashMap)\n\n## How To Use\n\nIn build.gradle:\n\n```gradle\ndependencies {\n    compile 'com.github.gfx.util:weak-identity-hash-map:2.0.+'\n}\n```\n\nIn code:\n\n```java\nActivity activity = ...;\nWeakIdentityHashMap\u003cActivity, String\u003e foo = new WeakIdentityHashMap\u003c\u003e()\n\n // Set an activity's field.\n // If activity is gone, this value is also gone, too.\nfoo.put(activity, \"my field\");\n\nString value = foo.get(activity); // \"my field\"\n```\n\n## TEST COVERAGES\n\n```\n./gradlew check jacocoTestReport\nopen library/build/reports/jacoco/test/html/index.html\n```\n\n\n## PERFORMANCE\n\nOn Xperia A / Android 4.2.2:\n\n\n```java\n// in an Activity's onCreate()\nMap\u003cActivity, String\u003e map = new WeakIdentityHashMap\u003c\u003e();\nmap.put(this, \"foo\");\n\nlong t0 = System.currentTimeMillis();\n\nfor (int i = 0; i \u003c 100000; i++) {\n    String a = map.get(this);\n    assert a != null;\n}\nLog.d(\"XXX\", \"WeakIdentityHashMap0: \" + (System.currentTimeMillis() - t0));\n\nt0 = System.currentTimeMillis();\n\nfor (int i = 0; i \u003c 200000; i++) {\n    String a = map.get(this);\n    assert a != null;\n}\nLog.d(\"XXX\", \"WeakIdentityHashMap1: \" + (System.currentTimeMillis() - t0));\n```\n\n1.0.0:\n\n```\nD/XXX﹕ WeakIdentityHashMap1: 449\nD/XXX﹕ WeakIdentityHashMap2: 1108\n```\n\n2.0.0:\n\n```\nD/XXX﹕ WeakIdentityHashMap1: 167\nD/XXX﹕ WeakIdentityHashMap2: 290\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfx%2Fjava-weakidentityhashmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfx%2Fjava-weakidentityhashmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfx%2Fjava-weakidentityhashmap/lists"}