Libraryless. Click here for Pure Java version (12678L/85K).
static <A extends Concept> void importAllConceptsOfType(Class<A> cClass, Cl<A> l, O... _) { bool debug = boolPar debug(_); Concepts cc = db_mainConcepts(); Set<Long> ids = mapToSet(l, c -> c.id); fOr (A c : l) { A existing = cast cc.getConcept(c.id); if (existing == null) { if (debug) print("import: adding " + c); cc.registerKeepingID(existing = c); } else { if (debug) print("import: updating " + c); copyConceptFields(c, existing); } } for (A c : cloneList(list(cc, cClass))) if (!ids.contains(c.id)) { if (debug) print("import: deleting " + c); deleteConcept(c); } }
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1026289 |
Snippet name: | importAllConceptsOfType - delete all concepts of type cClass and replace them with a list of unlisted concepts including IDs |
Eternal ID of this version: | #1026289/3 |
Text MD5: | a8c5b20ba487f557dbd93d9ba3e3b208 |
Transpilation MD5: | b4a916c03f6e21429194da67fd416bd9 |
Author: | stefan |
Category: | javax / comm |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-12-11 19:18:08 |
Source code size: | 666 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 210 / 310 |
Version history: | 2 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |