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

39
LINES

< > BotCompany Repo | #1023278 // findConceptsWhereCI

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

Libraryless. Click here for Pure Java version (14837L/95K).

static <A extends Concept> Cl<A> nuLike findConceptsWhereCI(Class<A> c, O... params) {
  ret findConceptsWhereCI(db_mainConcepts(), c, params);
}

static L<Concept> findConceptsWhereCI(S c, O... params) {
  ret findConceptsWhereCI(db_mainConcepts(), c, params);
}

static <A extends Concept> Cl<A> findConceptsWhereCI(Concepts concepts, Class<A> c, O... params) {
  Cl<A> l = findConceptsWhereCI_noParent(concepts, c, params);
  if (concepts.parent == null) ret l;
  ret concatCollections_conservative(l, findConceptsWhereCI(concepts.parent, c, params));
}
  
static <A extends Concept> Cl<A> findConceptsWhereCI_noParent(Concepts concepts, Class<A> c, O... params) {
  params = expandParams(c, params);
  
  // indexed
  if (concepts.ciFieldIndices != null)
    for (int i = 0; i < l(params); i += 2) {
      IFieldIndex<A, O> index = concepts.getCIFieldIndex(c, (S) params[i]);
      if (index != null) {
        Cl<A> rawList = index.getAll(params[i+1]);
        params = dropEntryFromParams(params, i);
        if (params == null) ret rawList;
        new L<A> l;
        for (A x : rawList)
          if (checkConceptFieldsIC(x, params)) l.add(x);
        ret l;
      }
    }
    
  // table scan
  ret filterConceptsIC(concepts.list(c), params);
}

static L<Concept> findConceptsWhereCI(Concepts concepts, S c, O... params) {
  ret filterConceptsIC(concepts.list(c), params);
}

Author comment

Began life as a copy of #1005064

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023278
Snippet name: findConceptsWhereCI
Eternal ID of this version: #1023278/9
Text MD5: cd20369a7e77e538a5fa7bb838233130
Transpilation MD5: 94b06ba3b59d38376366b8d49c0cfacd
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-06 12:30:41
Source code size: 1422 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 359 / 515
Version history: 8 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1024407 - conceptsSortedByFieldCI - try to use index if possible