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

16
LINES

< > BotCompany Repo | #1000513 // FJoin

JavaX fragment (include)

// TODO: why doesn't it extend ReversibleFunctionImpl?

static class FJoin extends FunctionImpl {
  String glue;
  
  *(String *glue) {}
  
  public O process(Object _in) {
    return join(glue, (List) _in);
  }
  
  public O unprocess(Object _in) {
    String in = cast _in;
    return new ArrayList<String>(Arrays.asList(in.split(glue)));
  }
}

Author comment

Began life as a copy of #1000510

download  show line numbers  debug dex  old transpilations   

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

2 comment(s) hidden. show

Snippet ID: #1000513
Snippet name: FJoin
Eternal ID of this version: #1000513/1
Text MD5: 32a5c0e17ac01670a91ad547cfc13841
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-18 18:48:50
Source code size: 361 bytes / 16 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 1117 / 1753
Referenced in: [show references]