Libraryless. Click here for Pure Java version (3846L/22K).
1 | // This is probably for use in Meta_v2 to get the most efficient |
2 | // (read compact) implementation of typical meta scenarios. |
3 | |
4 | interface MutatingMap<A, B> { |
5 | // Non-mutating: |
6 | |
7 | bool isEmpty(); |
8 | int size(); |
9 | ItIt<Pair<A, B>> iterator(); |
10 | bool containsKey(A a); |
11 | B get(A a); |
12 | |
13 | // hashCode/equals, not sure. |
14 | // maybe we shouldn't even have value semantics here |
15 | |
16 | // Mutating: |
17 | |
18 | MutatingMap<A, B> put(A a, B b); |
19 | MutatingMap<A, B> remove(A a); |
20 | MutatingMap<A, B> putAll(Map map); |
21 | MutatingMap<A, B> putAll(MutatingMap map); |
22 | MutatingMap<A, B> clear(); |
23 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032887 |
Snippet name: | MutatingMap [interface proposal for a map that can "shape-shift" (replace itself with a different object)] |
Eternal ID of this version: | #1032887/3 |
Text MD5: | 2f3bef87f542db0ba5caea73d0d9c216 |
Transpilation MD5: | 944afe1a6db67f449f03747e52f24d67 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-07 14:45:47 |
Source code size: | 615 bytes / 23 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 183 / 300 |
Version history: | 2 change(s) |
Referenced in: | [show references] |