static <A> Set<A> setWithNotify(final Runnable onChange) { ret setWithNotify(new HashSet, onChange); } static <A> Set<A> setWithNotify(Set<A> set, final Runnable onChange) { ret new NotifyingSet<A>(set) { void change() { onChange.run(); } }; }
Began life as a copy of #1012662
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020632 |
Snippet name: | setWithNotify - returns synchronized notifying set |
Eternal ID of this version: | #1020632/3 |
Text MD5: | 24984efe509d94f017dc40dd461236e9 |
Author: | stefan |
Category: | javax / collections |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-04-11 14:40:42 |
Source code size: | 262 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 338 / 377 |
Version history: | 2 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1021582 - setWithNotifyOnAdd - returns synchronized set that calls callback on successful add() (where element wasn't there before) |