Search in sources :

Example 1 with LexicalComparator

use of com.google.security.zynamics.zylib.general.comparators.LexicalComparator in project binnavi by google.

the class CTableSorter method getComparator.

@SuppressWarnings({ "unchecked", "rawtypes" })
protected Comparator<Object> getComparator(final int column) {
    final Class columnType = tableModel.getColumnClass(column);
    Comparator<Object> comparator = primaryColumnComparator.get(column);
    if (comparator != null) {
        return comparator;
    }
    comparator = columnComparators.get(columnType);
    if (comparator != null) {
        return comparator;
    }
    if (columnType.equals(String.class)) {
        return (Comparator) new LexicalComparator();
    }
    if (Comparable.class.isAssignableFrom(columnType)) {
        return COMPARABLE_COMPARATOR;
    }
    return (Comparator) new LexicalComparator();
}
Also used : LexicalComparator(com.google.security.zynamics.zylib.general.comparators.LexicalComparator) Comparator(java.util.Comparator) LexicalComparator(com.google.security.zynamics.zylib.general.comparators.LexicalComparator)

Aggregations

LexicalComparator (com.google.security.zynamics.zylib.general.comparators.LexicalComparator)1 Comparator (java.util.Comparator)1