Rashmi.B
Rashmi.B

Reputation: 1787

Sorting with BlackBerry

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()?

Upvotes: 0

Views: 476

Answers (3)

octo
octo

Reputation: 631

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

Upvotes: 1

Marc Novakowski
Marc Novakowski

Reputation: 45398

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

Upvotes: 2

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.

Upvotes: 0

Related Questions