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

13
LINES

< > BotCompany Repo | #1029961 // highestConceptByField

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

Libraryless. Click here for Pure Java version (13679L/93K).

1  
static <A extends Concept> A nuLike highestConceptByField(Class<A> c, S field) {
2  
  ret highestConceptByField(db_mainConcepts(), c, field);
3  
}
4  
5  
static <A extends Concept> A highestConceptByField(Concepts concepts, Class<A> c, S field) {
6  
  // indexed
7  
  IFieldIndex<A, O> index = concepts.getFieldIndex(c, field);
8  
  if (index cast ConceptFieldIndexDesc) {
9  
    Map.Entry e = ((NavigableMap) index.valueToObject.data).firstEntry();
10  
    ret e == null ? null : (A) first((Cl) e.getValue());
11  
  }
12  
  ret highestByField(field, concepts.list(c));
13  
}

Author comment

Began life as a copy of #1029654

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1029961
Snippet name: highestConceptByField
Eternal ID of this version: #1029961/1
Text MD5: e3975cedb7fe277050754ed146668610
Transpilation MD5: b686317fc4b16cdb46332d1ae925647a
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-10-23 09:44:08
Source code size: 547 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 114 / 171
Referenced in: [show references]