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

11
LINES

< > BotCompany Repo | #1018282 // listWithNotifyOnAdd - synchronized

JavaX fragment (include)

static <A> L<A> listWithNotifyOnAdd(final VF1<A> onAdd) {
  ret new NotifyingList<A>(new L) {
    void change() {}
    
    public bool add(A a) {
      if (!super.add(a)) false;
      callF(onAdd, a);
      true;
    }
  };
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018282
Snippet name: listWithNotifyOnAdd - synchronized
Eternal ID of this version: #1018282/4
Text MD5: 17d1ea458f9984c5a614485561ab8866
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-14 13:19:19
Source code size: 236 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 314 / 350
Version history: 3 change(s)
Referenced in: [show references]