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

19
LINES

< > BotCompany Repo | #1033394 // colToList

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

Transpiled version (5049L) is out of date.

static <A> L<A> colToList(Matrix<A> m, int x) {
  if (m == null) null;
  rangeCheck(x, m.getWidth());
  int h = m.getHeight();
  
  ret new RandomAccessAbstractList<A>() {
    public int size() { ret h; }
    
    public A get(int y) {
      ret m.get(x, y);
    }
    
    public A set(int y, A val) {
      A old = m.get(x, y);
      m.set(x, y, val);
      ret old;
    }
  };
}

Author comment

Began life as a copy of #1033132

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033394
Snippet name: colToList
Eternal ID of this version: #1033394/2
Text MD5: 073276082b2f4f27155345f781f1bde1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-27 01:49:12
Source code size: 399 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 215 / 298
Version history: 1 change(s)
Referenced in: [show references]