iterator - java.util.NoSuchElementException - on iterating over sorted treemap -


I'm looping on my program, and I did not get any errors

  EloRating Java.util.TreeMap $ .setNewSeason at $ KeyIterator.next (unknown source) java.util.TreeMap $ PrivateEntryIterator.nextEntry (unknown source) (Exception in thread "main" java.util.NoSuchElementException on EloRating. Java: 242) < / Code>  

This error indicates the Iterator loop.

  Treemark & ​​lt; String, double & gt; Treemark = New Treemark & ​​lt; String, double & gt; (); (; String, Double & gt; Sign in & lt Team: teamsIntersection.entrySet ()) {treeMap.put (. Team.getKey (), listTeams.get (team.getKey ()) getRating ()); } Sorted & lt; Entry & lt; String, double & gt; & Gt; List list = entries entered (tree map); Iterator & lt; Entry & lt; String, double & gt; & Gt; Iter = listSorted.iterator (); Int stop = (Zodiac intuction times + 1) / 2; For (Int i = 0; I <(stop -1); I ++) {----------- & gt; Iter.next (); } Dual Average = iter.next (). GetValue ();   

If I execute the program once, nothing is special. But for some benchmark reasons, I have been looped on 25,000 times the program with some slightly adjusted parameters. And when I try to start the program again from the parameter after an error, then it will proceed [at the time of this error, ifter is 10 values]

target

I Want to override the values ​​of HashMap teamsIntersection Like the one-3B1C2D-2E-5F4, I want 3th A

entriesSortedByValue
  Fixed the value of back from & lt; Kashmir, V comparative & lt; Enhances Super V & gt; & Gt; SortedSet & LT; Map.Entry & LT; Kashmir, V & gt; & Gt; The value sent for entries (Map, Lt., V & gt; Maps) {Sorted & lt; Map. Entry & lt; K, V & gt; & Gt; SortedEntries = new TreeSet & LT; Map.Entry & LT; Kashmir, V & gt; & Gt; (New Comparative & LT; Map.Entry & LT; K, V & gt; & gt; () {@Override Public Integer Comparison (Map.Entry & LT; K, V & gt; E1, MAP entry. & Lt; K, V> E2) {return e1.getValue (.) Compare (e2.getValue ());}}); SortedEntries.addAll (map.entrySet ()); Returns sorted; }   

If you have multiple entries with the same value, then Assume that merged comparator you have written, TreeSet dedups elements relative to your comparator.

Since the size of amountOfIntersectTeams is the map on which you are working, it is my best bet what is happening.

To fix this, I have my Comparator when the values ​​are equal to the same.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -