• Post Reply Bookmark Topic Watch Topic
  • New Topic

Comparator for sorting an object arraylist by float parameter  RSS feed

 
Pedro Neves
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i create a comparator to be able to sort an arraylist by a float parameter?

Imagine i have an arraylist of objects that has something like this:



I want to sort the array by TFIDF values.. As far as i know i can only sort them by integer.. Thus, im comparing zeros.

So far i have this:


But. Again, it compares me only the integer part. How can i compare the entire value?

Please help.

Thanks
 
Paul Clapham
Sheriff
Posts: 22823
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!