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

21
LINES

< > BotCompany Repo | #1033030 // OpusMachineIterator

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

Uses 521K of libraries. Compilation Failed (7508L/44K).

sclass OpusMachineIterator extends CloseableShortIterator {
  OpusMachine machine;
  *(OpusMachine *machine) { ownResource(machine); }
  
  !include #1033023 // Resources mix-in
  
  int val = Int.MAX_VALUE;
  
  bool hasNext() {
    if (val == Int.MAX_VALUE)
      val = machine!;
    ret val != Int.MIN_VALUE;
  }
      
  short next() {
    if (!hasNext()) fail("No such element");
    var v = val;
    val = Int.MAX_VALUE;
    ret (short) v;
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033030
Snippet name: OpusMachineIterator
Eternal ID of this version: #1033030/7
Text MD5: f869b4195098ac3a302c65663bf2ac30
Transpilation MD5: dfa359f5937c9974339fa179a1914d43
Author: stefan
Category: javax / audio analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-11 13:50:34
Source code size: 471 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 221 / 358
Version history: 6 change(s)
Referenced in: [show references]