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

22
LINES

< > BotCompany Repo | #1025184 // FloatBool - float plus bool (e.g. a brightness value + decision if it is "white")

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

Libraryless. Click here for Pure Java version (2286L/15K).

sclass FloatBool implements IPair<Float, Bool> {
  float f;
  bool b;
  
  *() {}
  *(float *f, bool *b) {}
  
  toString { ret f + "/" + b; }
  
  public int hashCode() {
    ret boostHashCombine(hashOfFloat(f), hashOfBool(b));
  }
  
  public bool equals(O o) {
    ret o instanceof FloatBool
      && f == o/FloatBool.f
      && b == o/FloatBool.b;
  }
  
  public Float a() { ret f; }
  public Bool b() { ret b; }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025184
Snippet name: FloatBool - float plus bool (e.g. a brightness value + decision if it is "white")
Eternal ID of this version: #1025184/4
Text MD5: d4f8ad643f45fac208688a54d799edc3
Transpilation MD5: c0035839f2546959fef7e06c4f2367be
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-12 22:18:37
Source code size: 440 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 193 / 564
Version history: 3 change(s)
Referenced in: [show references]