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

15
LINES

< > BotCompany Repo | #1024255 // distinctCIFieldValuesOfConcepts_multiSet - unique field values plus count, case-insensitive

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

Libraryless. Click here for Pure Java version (14918L/96K).

static <A extends Concept> MultiSet<S> nuLike distinctCIFieldValuesOfConcepts_multiSet(Class<A> c, S field) {
  ret distinctCIFieldValuesOfConcepts_multiSet(db_mainConcepts(), c, field);
}

static <A extends Concept> MultiSet<S> distinctCIFieldValuesOfConcepts_multiSet(Concepts concepts, Class<A> c, S field) {
  // indexed
  IFieldIndex<A, S> index = concepts.getCIFieldIndex(c, field);
  if (index != null)
    ret index.allValues_multiSet();

  // table scan
  MultiSet<S> set = ciMultiSet();
  for (A x : concepts.list(c)) set.add((S) getOpt(x, field));
  ret set;
}

Author comment

Began life as a copy of #1024253

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: #1024255
Snippet name: distinctCIFieldValuesOfConcepts_multiSet - unique field values plus count, case-insensitive
Eternal ID of this version: #1024255/4
Text MD5: 21b4231c59514d18ad163966011d844c
Transpilation MD5: c6e333229e7f73a8788f3cc6dc34f54d
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-17 15:12:36
Source code size: 585 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 262 / 380
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)