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

13
LINES

< > BotCompany Repo | #1023775 // applyAttractors_getRuleAndStringEmits

JavaX fragment (include)

1  
static Pair<Collection<Attractor>, Set<S>> applyAttractors_getRuleAndStringEmits(L<? extends Attractor> rules, S s) {
2  
  new L<Attractor> newRules;
3  
  Set<S> strings = ciSet();
4  
  
5  
  for unnull (Attractor rule : rules)
6  
    if (rule.matches(s)) {
7  
      L emits = getEmits(rule);
8  
      addAll(newRules, instancesOf Attractor(emits));
9  
      addAll(strings, stringsOnly(emits));
10  
    }
11  
    
12  
  ret pair(newRules, strings);
13  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1023775
Snippet name: applyAttractors_getRuleAndStringEmits
Eternal ID of this version: #1023775/3
Text MD5: ad74c203780610bb330b3912430529ac
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-08 23:08:28
Source code size: 429 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 245 / 280
Version history: 2 change(s)
Referenced in: [show references]