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

17
LINES

< > BotCompany Repo | #1027757 // AllOnAllOperation

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

Libraryless. Click here for Pure Java version (104L/1K).

// persistable (if you set "operation", make sure it's with a
// persistable object)
sclass AllOnAllOperation<A, B> implements Steppable {
  Producer<Pair<A, B>> allOnAll; // e.g. an instance of AllOnAll<A, B>
  
  *() {}
  *(Producer<Pair<A, B>> *allOnAll, IVF2<A, B> *operation) {}
  
  persistent swappable void operation(A a, B b) {}

  public bool step() {
    Pair<A, B> p = allOnAll.next();
    if (p == null) false;
    operation(p.a, p.b);
    true;
  }
}

Author comment

Began life as a copy of #1023892

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027757
Snippet name: AllOnAllOperation
Eternal ID of this version: #1027757/7
Text MD5: cb73213120843589e6a777abe81371c7
Transpilation MD5: 99bbdab19f0a5c678efea3b09687ef05
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-20 23:50:53
Source code size: 480 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 320 / 671
Version history: 6 change(s)
Referenced in: #1027759 - AllOnAllWithOperation
#1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)