info.joseluismartin.util.comparator
Class PropertyComparator
java.lang.Object
info.joseluismartin.util.comparator.PropertyComparator
- All Implemented Interfaces:
- Comparator<Object>
public class PropertyComparator
- extends Object
- implements Comparator<Object>
Comparator for generic beans by property value.
is an alphaNumeric comparator. When two string have numbers
and have same prefix, use numeric comparation so test_10 > than test_2
- Author:
- Jose Luis Martin - (jlm@joseluismartin.info)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertyComparator
public PropertyComparator(String name)
- ctor
- Parameters:
name - property name
compare
public int compare(Object o1,
Object o2)
- Specified by:
compare in interface Comparator<Object>
- Parameters:
o1 - one beano2 - another bean
- Returns:
- see the see
- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
getComparator
public Comparator<String> getComparator()
- Returns:
- the comparator
setComparator
public void setComparator(Comparator<String> comparator)
- Parameters:
comparator - the comparator to set
Copyright © 2012 JDAL. All Rights Reserved.