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

19
LINES

< > BotCompany Repo | #1033395 // rowToList

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

Transpiled version (5049L) is out of date.

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

Author comment

Began life as a copy of #1033394

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033395
Snippet name: rowToList
Eternal ID of this version: #1033395/3
Text MD5: 235010ee5b816e8e0bfffe63a7337bda
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:20
Source code size: 399 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 89 / 119
Version history: 2 change(s)
Referenced in: [show references]