0
我有一个列表结果列表,并且我想在对象[]的内容之后对列表进行排序。所以我想在帐户'row [11]'后面排序,然后是'row'[1]'。我如何使用Groovy进行第二类?对第二个标准之后的排序列表进行排序
Object[] row = (Object[]) resultList.get(i);
String account = row[11];
String vehicle = row[1];
例
Account Vehicle
HKB 300 - PB
HKV 400 - PDAAA
HMN 200 - PBC200
HZA 155 - PCL
HZA 160 - PGA100
HZAB 165 - PGA100
HZAC 170 - PGA100
代码
int execute(List <Object[]> resultList) {
Object[] row = null;
resultList = resultList.sort{ a,b -> a[11] <=> b[11]};
//Then here I want to sort the sorted resultList after the vehicle also second group.
for (int i=resultList.size()-1; i >= 0; i--) {
row = (Object[]) resultList.get(i);
String account = row[11];
String vehicle = row[1];
}
return 1;
}
你能想出一些示例输入和预期输出吗? –