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

14
LINES

< > BotCompany Repo | #1024460 // navigableMultiSetMapValuesIterator - iterates concurrently; doesn't handle null values; only for TreeMaps for now [dev.]

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

Libraryless. Click here for Pure Java version (2171L/14K).

static <A, B> IterableIterator<B> navigableMultiSetMapValuesIterator(final MultiSetMap<A, B> mm) {
  ret iteratorFromFunction(new F0<B>() {
    Iterator<Set<B>> it = concurrentlyIterateValues((NavigableMap) mm.data);
    Iterator<B> it2;
    
    public B get() {
      while (it2 == null || !it2.hasNext()) {
        if (!it.hasNext()) null;
        it2 = iterator(asList(it.next()));
      }
      ret it2.next();
    }
  });
}

Author comment

Began life as a copy of #1013540

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: #1024460
Snippet name: navigableMultiSetMapValuesIterator - iterates concurrently; doesn't handle null values; only for TreeMaps for now [dev.]
Eternal ID of this version: #1024460/4
Text MD5: 98ab5fff81833f77f884711f422398e2
Transpilation MD5: cc62aae1b2e149b315a8a346d877c427
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-13 12:28:16
Source code size: 442 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 165 / 240
Version history: 3 change(s)
Referenced in: [show references]