public Sorting clone() { return new Sorting(this.fieldOrders); }
/** * Creates a new sorting from the given string and returns it, or returns null if the argument does not contain * any sorting criteria (e.g it is null or the empty string) */ public static Sorting fromString(String sortSpec) { if (sortSpec==null) return null; if ("".equals(sortSpec)) return null; return new Sorting(sortSpec); }
/** Sets sorting from a string. See {@link Sorting} on syntax */ public void setSorting(String sortingString) { if (sortingString==null) setSorting((Sorting)null); else setSorting(new Sorting(sortingString)); }
if (sourceIndex>=0) { // replace alphabetical sorting on source by sourceList order sorting if (sourceIndex>0) // sort fields before the source beforeSource=new Sorting(new ArrayList<>(sorting.fieldOrders().subList(0,sourceIndex))); if (sorting.fieldOrders().size()>sourceIndex+1) // sort fields after the source afterSource=new Sorting(new ArrayList<>(sorting.fieldOrders().subList(sourceIndex+1,sorting.fieldOrders().size()+1)));
sorting = new Sorting(sortingInit); return ast.getArgument(0);