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

19
LINES

< > BotCompany Repo | #1031167 // SynchronizedSet [JDK-derived version]

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (154L/2K).

1  
static persistable class SynchronizedSet<E>
2  
      extends SynchronizedCollection<E>
3  
      implements Set<E> {
4  
    SynchronizedSet(Set<E> s) {
5  
        super(s);
6  
    }
7  
    SynchronizedSet(Set<E> s, Object mutex) {
8  
        super(s, mutex);
9  
    }
10  
11  
    public boolean equals(Object o) {
12  
        if (this == o)
13  
            return true;
14  
        synchronized (mutex) {return c.equals(o);}
15  
    }
16  
    public int hashCode() {
17  
        synchronized (mutex) {return c.hashCode();}
18  
    }
19  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031167
Snippet name: SynchronizedSet [JDK-derived version]
Eternal ID of this version: #1031167/2
Text MD5: 24793f59b129cac3816098588074d7ea
Transpilation MD5: 1505c7c5b9b6f0bf054250f470de53b3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-16 17:46:56
Source code size: 494 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 110 / 281
Version history: 1 change(s)
Referenced in: [show references]