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) [tags: use-pretranspiled]

Transpiled version (43L) is out of date.

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 && b != 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 && b != null) a.putAll(b);
  ret a;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004686
Snippet name: addAll - generalizes Collection.addAll
Eternal ID of this version: #1004686/12
Text MD5: 338b472a3370e2eaa2ba0ad6e75e7df4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-11 20:44:00
Source code size: 675 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 567 / 948
Version history: 11 change(s)
Referenced in: #1006654 #1015243 #1021319