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).

final sclass LongRange {
  long start, end;
  
  *() {}
  *(long *start, long *end) {}
  
  public bool equals(O o) {
    if (o cast LongRange) ret start == o.start && end == o.end;
    false;
  }
  
  public int hashCode() {
    ret boostHashCombine(hashOfLong(start), hashOfLong(end));
  }
  
  long length() { ret end-start; }
  
  sS _fieldOrder = "start end";
  
  toString { ret "[" + start + ";" + end + "]"; }
}

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: 362 / 990
Version history: 3 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)