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

Comments [hide]

ID Author/Program Comment Date
521 #1000610 Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
// 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)));
}
}
}}
2015-08-18 18:48:59  delete 
518 #1000604 (pitcher) 2015-08-18 18:48:50

add comment

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: 1136 / 1775
Referenced in: [show references]