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

17
LINES

< > BotCompany Repo | #1024407 // conceptsSortedByFieldCI - try to use index if possible

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

Libraryless. Click here for Pure Java version (12638L/86K).

1  
sbool conceptsSortedByFieldCI_verbose;
2  
3  
static <A extends Concept> Cl<A> nuLike conceptsSortedByFieldCI(Class<A> c, S field) {
4  
  ret conceptsSortedByFieldCI(db_mainConcepts(), c, field);
5  
}
6  
7  
static <A extends Concept> Cl<A> conceptsSortedByFieldCI(Concepts concepts, Class<A> c, S field) {
8  
  // indexed
9  
  IFieldIndex<A, O> index = concepts.getCIFieldIndex(c, field);
10  
  if (index cast ConceptFieldIndexCI)
11  
    ret (Cl<A>) asList(index.objectIterator());
12  
    
13  
  // sort manually
14  
  if (conceptsSortedByFieldCI_verbose)
15  
    print("conceptsSortedByFieldCI_verbose: Manual sort of " + c + " for " + field);
16  
  ret sortedByFieldIC(field, concepts.list(c));
17  
}

Author comment

Began life as a copy of #1023278

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: #1024407
Snippet name: conceptsSortedByFieldCI - try to use index if possible
Eternal ID of this version: #1024407/7
Text MD5: 083fe630af781f8a5e65f1cabaca89d5
Transpilation MD5: a65d62606606de680e8a95385c6365a8
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-10 19:08:12
Source code size: 665 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 156 / 242
Version history: 6 change(s)
Referenced in: [show references]