hi,do you know how to do this in java?
On Thursday, July 30, 2009 2:28:29 AM UTC+8, Kenton Varda wrote:
In C++, you can use the standard STL sort() function:
http://www.sgi.com/tech/stl/sort.html
http://www.sgi.com/tech/stl/sort.htmlRepeatedPtrField supports
iterators, so you can do
how to sort it using java?
在 2009年7月30日星期四UTC+8上午2时28分29秒,Kenton Varda写道:
In C++, you can use the standard STL sort() function:
http://www.sgi.com/tech/stl/sort.html
http://www.sgi.com/tech/stl/sort.htmlRepeatedPtrField supports
iterators, so you can do something like:
#include
thanks,this is what i looking for.
On Jul 30, 2:28 am, Kenton Varda ken...@google.com wrote:
In C++, you can use the standard STL sort()
function:http://www.sgi.com/tech/stl/sort.html
http://www.sgi.com/tech/stl/sort.htmlRepeatedPtrField supports iterators,
so you can do something like:
You can write a customize sort functor when using the stl, which sort the
index of the students, like:struct SortStudent : public
binnary_functionbool, int, int {
SortStudent(Class *cl) : cl_(cl) {
}
bool operator() (int i, int j) {
int32 score1 = cl_-student(i).score();
int32 score2 =
In C++, you can use the standard STL sort() function:
http://www.sgi.com/tech/stl/sort.html
http://www.sgi.com/tech/stl/sort.htmlRepeatedPtrField supports iterators,
so you can do something like:
#include algorithm
struct StudentOrdering {
inline operator()(const Student* a, const
example:
==.proto file
message Class{
message Student{
required string name = 1;
required int32 score = 2;
}
repeated Student student = 1;
}
=
I want to sort students of the class by score,how can i do?