Re: Way to sort / enforce order for Map.entrySet?
Lew wrote:
I get it. So if one has an answer to give, but thinks the OP should
do SOME of the work themselves, there's no point in posting the
answer? We don't expect people to think and learn and deduce any
more? What kind of programmers will they turn out to be, then?
Tom Anderson wrote:
Ones whose careers depend on continuing to buy me beer.
You are the master! I bow to your wisdom!
I totally always use sigdashes! Are mine being eaten too?
You used them, and they worked, but they are ignored by the browser-based
reader I was using at that time, and part of your sig was above them.
Lew wrote:
I guess the message of your message is that people shouldn't have to
think.
Tom Anderson wrote:
I do not believe i [sic] expressed a normative opinion on the matter.
No doubt, but why would I let that spoil my rhetoric?
Mind you, I have no objection to providing code to help the OP.
I do have a real objection to one ignoring advice that lacks every last
freaking detail of the code and prevents the querent from having to do any
work whatsoever. The OP pretended that your answer came out of nowhere, and
that no one else had suggested the same thing, as if the lack of code made the
other answer(s) any less valuable.
If they really didn't see the value of being told,
"Custom Comparator. Load the entries into a SortedSet with that
Comparator."
then they should have *asked* about it. Then when you gave the code for that
(I assume that's what they were really answering, not the post to which they
actually replied) they pretended like you were the first to even suggest such
a thing in answer to their question.
laredotornado, you are not going to make real progress in computer programming
until you grasp how to take a topic suggestion into code. There are wise
people out there, for example Roedy Green, who will give you a signpost to the
restaurant instead of a sandwich. Feed a man a meal and you feed him for an
hour; send him to the diner and you feed him for a lifetime. In this very
thread Roedy gave you good advice, and you threw it away dismissively by
saying only,
I do use a TreeMap --
"final Map<String, String> map = new
TreeMap<String, String>();",
but the order is not getting preserved when I call "map.entrySet".
And you didn't even provide an SSCCE! What is wrong with you?
--
Lew