EEC is provided with an own comparator (DefaultStringComparator), which lexicographic sorts strings. This enables the correct treatment of numbers. This allows strings of the type Text1, Text2, ... , Text10, Text11 to be sorted correctly. This comparator is also used in the formula language to sort string lists.
The following example code shows the sorting of string lists and of string arrays:
import org.foederal.util.DefaultStringComparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
// Erstellen des Beispiel-Array und der Beispiel-Liste
stringArray = new String[] { "text5","text30", "text10", "text1", "text2"};
stringList = new ArrayList(Arrays.asList(stringArray));
// Sortieren
Arrays.sort(stringArray, new DefaultStringComparator());
Collections.sort(stringList, new DefaultStringComparator());