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).

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

static <A extends Concept> A highestConceptByField(Concepts concepts, Class<A> c, S field) {
  // indexed
  IFieldIndex<A, O> index = concepts.getFieldIndex(c, field);
  if (index cast ConceptFieldIndexDesc) {
    Map.Entry e = ((NavigableMap) index.valueToObject.data).firstEntry();
    ret e == null ? null : (A) first((Cl) e.getValue());
  }
  ret highestByField(field, concepts.list(c));
}

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: 167 / 240
Referenced in: [show references]