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

20
LINES

< > BotCompany Repo | #1033710 // wrapLongBufferAsPtList

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

Libraryless. Click here for Pure Java version (5210L/29K).

1  
static L<Pt> wrapLongBufferAsPtList(LongBuffer buf default new LongBuffer) {
2  
  ret new RandomAccessAbstractList<Pt>() {
3  
    public int size() { ret buf.size(); }
4  
    
5  
    public Pt get(int i) {
6  
      ret longToPt(buf.get(i));
7  
    }
8  
    
9  
    public Pt set(int i, Pt val) {
10  
      Pt old = get(i);
11  
      buf.set(i, ptToLong(val));
12  
      ret old;
13  
    }
14  
    
15  
    public bool add(Pt p) {
16  
      buf.add(ptToLong(p));
17  
      true;
18  
    }
19  
  };
20  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033710
Snippet name: wrapLongBufferAsPtList
Eternal ID of this version: #1033710/4
Text MD5: f92453ddda63ed6b42f5b38ca2bb9354
Transpilation MD5: cd524b951bb9d2bef35ca7911b61cc6b
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-01 22:36:13
Source code size: 453 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 75 / 125
Version history: 3 change(s)
Referenced in: [show references]