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

24
LINES

< > BotCompany Repo | #1004216 // T3 - value triple - synonym: Triple

JavaX fragment (include)

1  
static class T3<A, B, C> {
2  
  A a;
3  
  B b;
4  
  C c;
5  
  
6  
  *() {}
7  
  *(A *a, B *b, C *c) {}
8  
  *(T3<A, B, C> t) { a = t.a; b = t.b; c = t.c; }
9  
  
10  
  public int hashCode() {
11  
    ret _hashCode(a) + 2*_hashCode(b) - 4*_hashCode(c);
12  
  }
13  
  
14  
  public bool equals(O o) {
15  
    if (o == this) true;
16  
    if (!(o instanceof T3)) false;
17  
    T3 t = (T3) o;
18  
    ret eq(a, t.a) && eq(b, t.b) && eq(c, t.c);
19  
  }
20  
  
21  
  toString {
22  
    ret "(" + quoteBorderless(a) + ", " + quoteBorderless(b) + ", " + quoteBorderless(c) + ")";
23  
  }
24  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004216
Snippet name: T3 - value triple - synonym: Triple
Eternal ID of this version: #1004216/7
Text MD5: a3c8c0bdb47d35eae362cf0ddf41b911
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-13 23:36:05
Source code size: 526 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 624 / 2834
Version history: 6 change(s)
Referenced in: [show references]