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.

// Unit doesn't have to be a singleton since we override
// equals and hashCode

final sclass Unit {
  static Unit unit = new(true);
  
  static Unit get() { ret unit; }
  
  toString { ret "unit"; }
  
  @Override public bool equals(O o) { ret o instanceof Unit; }
  @Override public int hashCode() { ret 1337; }
}

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: 182 / 508
Version history: 9 change(s)
Referenced in: [show references]