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

13
LINES

< > BotCompany Repo | #1028254 // Unit - unit type + instance

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

Transpiled version (4915L) is out of date.

1  
// Unit doesn't have to be a singleton since we override
2  
// equals and hashCode
3  
4  
final sclass Unit {
5  
  static Unit unit = new(true);
6  
  
7  
  static Unit get() { ret unit; }
8  
  
9  
  toString { ret "unit"; }
10  
  
11  
  @Override public bool equals(O o) { ret o instanceof Unit; }
12  
  @Override public int hashCode() { ret 1337; }
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028254
Snippet name: Unit - unit type + instance
Eternal ID of this version: #1028254/10
Text MD5: 7f1551414c1c30cfdc4c994d4dc9717c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-09 23:54:32
Source code size: 327 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 257 / 611
Version history: 9 change(s)
Referenced in: [show references]