Sorting with BlackBerry

 ̄綄美尐妖づ 提交于 2019-12-25 00:37:45

问题


I have a file consisting of entries like Paula 100, Steve 150, Julian 200. I want to sort this.

Can I use the Collections framework in BlackBerry to sort file entries consisting of numbers and names? I can't find any sorting program for blackberry. So I am wondering if I can use Collections.sort()?


回答1:


There are sortable collections in the BlackBerry API that you can use. Search the JavaDocs for things like SimpleSortingVector and BigVector.




回答2:


Unfortunately, BlackBerry uses J2ME which doesn't include the Collections framework. However, you can still do sorting of Arrays using the Arrays class.




回答3:


Yes, you can use it. It's not specifically a Blackberry thing; it's just generic Java.

You may wish to use the version that takes a Comparator, and implement that interface so that it orders your list items in the way you wish to sort them.



来源:https://stackoverflow.com/questions/4069579/sorting-with-blackberry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!