Author Archives: Marc Miller

Composite Comparator

Available at GitHub: Allows two comparators to be merged, so that if the major comparator returns equal, the other comparator is used. This can then be used to form composite comparisons. Example: java.util.Collections.sort(list,         new CompositeComparator(new BeanPropertyComparator("lastName"),             new BeanPropertycComparator("firstName") ) … Continue reading

Posted in Code | Tagged | Leave a comment