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

15
LINES

< > BotCompany Repo | #1009419 // SynchronizedSet

JavaX fragment (include)

1  
sclass SynchronizedSet<A> extends SynchronizedCollection<A> implements Set<A> {
2  
  *() {} // for persistence
3  
  *(Set<A> set) { super(set); }
4  
  *(Set<A> set, O mutex) { super(set, mutex); }
5  
  
6  
  public boolean equals(Object o) {
7  
      if (this == o)
8  
          return true;
9  
      synchronized (this) {return c.equals(o);}
10  
  }
11  
  
12  
  public int hashCode() {
13  
      synchronized (this) {return c.hashCode();}
14  
  }
15  
}

Author comment

Began life as a copy of #1009418

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009419
Snippet name: SynchronizedSet
Eternal ID of this version: #1009419/4
Text MD5: e54eb2741e0123f4adc110242824d5f7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-23 12:04:23
Source code size: 420 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 489 / 2378
Version history: 3 change(s)
Referenced in: [show references]