Note that there are some explanatory texts on larger screens.

plurals
  1. USDaveM
    primarykey
    data
    text
    plurals
    1. CO@JBNizet I must appologise I was getting very upset at you. My code seemed to be happily adding in TreeMap objects as keys, so I didn't believe you! So I modified my above code, ran the test... and I can o announce my code was seriously flawed somewhere down the line. I now need a better 'sorting' solution to my legacy DB data mining. I need to offer you a big thankyou, otherwise I may have been chasing this for a long time and it wouldn't have caused me problems untill later on. So back to using hashMaps for some stuff and sending the data into an SQLite / DerbyDB before playing with it!
      singulars
    2. CO@JBNizet OK I just tested it. My actual code is obviously printing out info before it gets put into the TreeMap, so it looks like the treeMap is getting the data when in fact it isn't. Back to using unordered HashMaps, or subClassing TreeMap.
      singulars
    3. CO@JBNizet The doc states that TreMap.put(k,v) Throws: ClassCastException - if the specified key cannot be compared with the keys currently in the map. So if TreeMap doesn't implement both comparable and hashcode somewhere in its inheritence I wouldn't be able to use one as a key without throwing an error (which doesn't happen). That is probably a better description of my question. TreeMap is apparently not comparable, so I shouldn't be able to use one as a key in my TreeMap.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload