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

22
LINES

< > BotCompany Repo | #1004686 - addAll - generalizes Collection.addAll

JavaX fragment (include)

static <A, B extends A> void addAll(Collection<A> c, Iterable<B> b) {
  if (c != null && b != null) for (A a : b) c.add(a);
}

static <A, B extends A> bool addAll(Collection<A> c, Collection<B> b) {
  ret c != null && b != null && c.addAll(b);
}

static <A, B extends A> bool addAll(Collection<A> c, B... b) {
  ret c != null && c.addAll(Arrays.asList(b));
}

ifclass Collector
static <A, B extends A> void addAll(Collector<A> c, Iterable<B> b) {
  if (c != null && b != null) for (A a : b) c.add(a);
}
endif

static <A, B> Map<A, B> addAll(Map<A, B> a, Map<? extends A,? extends B> b) {
  if (a != null) a.putAll(b);
  ret a;
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1004686
Snippet name: addAll - generalizes Collection.addAll
Eternal ID of this version: #1004686/10
Text MD5: e0e71a6f65bebbe9cbc41960178cdf1e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-14 23:19:48
Source code size: 649 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 464 / 786
Version history: 9 change(s)
Referenced in: [show references]

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