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


< > BotCompany Repo | #1033581 - BitSetMatrix - simple BitSet-based implementation of BitMatrix

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

Libraryless. Click here for Pure Java version (5427L/30K).

// implements BitMatrix
persistable sclass BitSetMatrix extends AbstractMatrix<Bool> {
  new BitSet bs;
  *(int *w, int *h) {}
  *(int *w, int *h, BitSet *bs) {}

  public Bool get(int x, int y) { ret bs.get(y*w+x); }
  public void set(int x, int y, Bool a default true) { bs.set(y*w+x, a); }

Author comment

Began life as a copy of #1033112

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033581
Snippet name: BitSetMatrix - simple BitSet-based implementation of BitMatrix
Eternal ID of this version: #1033581/6
Text MD5: 3a92f7287ba1af267390dceea9aa040b
Transpilation MD5: 6dd618600caa103003b404f8bbbe394c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-12-25 17:30:39
Source code size: 306 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 36 / 66
Version history: 5 change(s)
Referenced in: [show references]