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

1  
sclass FloatBool implements IPair<Float, Bool> {
2  
  float f;
3  
  bool b;
4  
  
5  
  *() {}
6  
  *(float *f, bool *b) {}
7  
  
8  
  toString { ret f + "/" + b; }
9  
  
10  
  public int hashCode() {
11  
    ret boostHashCombine(hashOfFloat(f), hashOfBool(b));
12  
  }
13  
  
14  
  public bool equals(O o) {
15  
    ret o instanceof FloatBool
16  
      && f == o/FloatBool.f
17  
      && b == o/FloatBool.b;
18  
  }
19  
  
20  
  public Float a() { ret f; }
21  
  public Bool b() { ret b; }
22  
}

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: 249 / 640
Version history: 3 change(s)
Referenced in: [show references]