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

15
LINES

< > BotCompany Repo | #1012662 - listWithNotify - returns synchronized notifying list

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2402L/15K).

static <A> NotifyingList<A> listWithNotify(final Runnable onChange) {
  ret listWithNotify(new L, onChange);
}

static <A> NotifyingList<A> listWithNotify(L<A> l, Runnable onChange) {
  ret new NotifyingList<A>(l) {
    void change() { onChange.run(); }
  };
}

static <A> NotifyingList<A> listWithNotify(fO onChange) {
  ret new NotifyingList<A>(new L) {
    void change() { callF(onChange); }
  };
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1012662
Snippet name: listWithNotify - returns synchronized notifying list
Eternal ID of this version: #1012662/7
Text MD5: 8bc88e30b0bbc5c26f05cb79841a09b8
Transpilation MD5: c1c0447fb695a712dc2e0d71b0902068
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-23 16:41:41
Source code size: 415 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 279 / 302
Version history: 6 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1012662 & http://1012662.tinybrain.de