mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 08:38:03 -06:00
Start using the fields in scouting
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.astatin3.scoutingapp2025.utility;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class JSONUtil {
|
||||
public static JSONArray sort(JSONArray array, Comparator c){
|
||||
List asList = new ArrayList(array.length());
|
||||
for (int i=0; i<array.length(); i++){
|
||||
asList.add(array.opt(i));
|
||||
}
|
||||
asList.sort(c);
|
||||
JSONArray res = new JSONArray();
|
||||
for (Object o : asList){
|
||||
res.put(o);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user