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

11
LINES

< > BotCompany Repo | #1002392 // makeEleuSet - makes a set from askSelf question ("is X an Y?")

JavaX fragment (include)

1  
static Set<S> makeEleuSet(final S className) {
2  
  // It's a "degenerate" set that only supports contains().
3  
  
4  
  ret new AbstractSet<S>() {
5  
    public Iterator<S> iterator() { ret null; }
6  
    public int size() { ret -1; }
7  
    public boolean contains(O o) {
8  
      ret matchStart("yes", askSelf(format("is * " + a(className), ((S) o))));
9  
    }
10  
  };
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002392
Snippet name: makeEleuSet - makes a set from askSelf question ("is X an Y?")
Eternal ID of this version: #1002392/1
Text MD5: d74ecb2e339e2a595068734ff488880a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-01-18 21:12:58
Source code size: 357 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 685 / 897
Referenced in: [show references]