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

12
LINES

< > BotCompany Repo | #1033027 // TreeHasKeyMap - sorted HasKeyMap

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

Libraryless. Click here for Pure Java version (3998L/23K).

sclass TreeHasKeyMap<A, B extends HasKey<A>> extends HasKeyMap<A, B> {
  *() { init(); }
  *(Iterable<B> l) { init(); addAll(l); }
   
  void init { map = new TreeMap; }
  
  TreeMap<A, B> map() { ret (TreeMap) map; }
  
  A lastKey() { ret main lastKey(map()); }
  
  B higher(B a) { ret a == null ?: higherValue(map(), a.getKey()); }
}

Author comment

Began life as a copy of #1032972

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033027
Snippet name: TreeHasKeyMap - sorted HasKeyMap
Eternal ID of this version: #1033027/10
Text MD5: 0c5545589e9eb7608a8da3459bca71fc
Transpilation MD5: 5d424e9fc519adf8f541ae33b1b1858f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-18 04:22:07
Source code size: 348 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 176 / 315
Version history: 9 change(s)
Referenced in: [show references]