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

21
LINES

< > BotCompany Repo | #1020603 // class LongRange - range of longs (start/end)

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

Libraryless. Click here for Pure Java version (67L/1K).

1  
final sclass LongRange {
2  
  long start, end;
3  
  
4  
  *() {}
5  
  *(long *start, long *end) {}
6  
  
7  
  public bool equals(O o) {
8  
    if (o cast LongRange) ret start == o.start && end == o.end;
9  
    false;
10  
  }
11  
  
12  
  public int hashCode() {
13  
    ret boostHashCombine(hashOfLong(start), hashOfLong(end));
14  
  }
15  
  
16  
  long length() { ret end-start; }
17  
  
18  
  sS _fieldOrder = "start end";
19  
  
20  
  toString { ret "[" + start + ";" + end + "]"; }
21  
}

Author comment

Began life as a copy of #1008631

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1020603
Snippet name: class LongRange - range of longs (start/end)
Eternal ID of this version: #1020603/4
Text MD5: 62327409de87c4a71365c459de9ac64f
Transpilation MD5: cc9ffe1fa7dd6d1d3b1cded080d6a539
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-13 11:28:02
Source code size: 439 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 452 / 1106
Version history: 3 change(s)
Referenced in: [show references]