What form is the data in? Strings in an array or a container of some type?
Or is it all in one String that needs to be parsed into separate records before sorting?

The Arrays class has several sort() methods that could work for you.