Please tell us what the app does. Write it down in words of one syllable. What do you use to sort on? Why do you sort on Integers?
That will be far more useful than our trying to go through a main method which is far too long.
posted 5 years ago
I have a collection of objects that can be accessed via and index, i.e. collection.get(index). I would like to sort an array of integers (indices) that point to the collection, so that the indices come out in order such that the following are in decreasing order collection.get(indices.get(1)) >= collection.get(indices.get(2)) >= collection.get(indices.get(3)), etc. So, I'm trying to sort based on indices, and leave the collection alone.
The following code works, but uses an auxiliary class to hold the collection and sort based on the indices. The original question used a "implicit class member" declaration on the collections.sort command. The question is why doesn't the implicit class formulation work?
If the question is not clear, please ask a question about the information presented.