Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1012182 // SyncListMultiMap - MultiMap with SynchronizedArrayList instead of ArrayList

JavaX fragment (include)

// Technically this violates the one-synced-object-per-thread
// principle (syncing on data and on an individual). Don't think
// it's a problem.
sclass SyncListMultiMap<A, B> extends MultiMap<A,B> {

  *() {}
  *(bool useTreeMap) { super(useTreeMap); }
  *(Map<A, L<B>> *data) {}
  
  L<B> _makeEmptyList() {
    ret new SynchronizedArrayList;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012182
Snippet name: SyncListMultiMap - MultiMap with SynchronizedArrayList instead of ArrayList
Eternal ID of this version: #1012182/3
Text MD5: 0d935103eee748fe1950364bf95972d3
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-04 00:08:32
Source code size: 362 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 407 / 985
Version history: 2 change(s)
Referenced in: [show references]