@Override
public int compareTo(final myRow another) {
final int BEFORE =-1;
final int EQUAL = 0;
final int AFTER = 1;
my code now :
public enum user_type {USER_TYPE_FRIEND(1), USER_TYPE_NORMAL(2), USER_TYPE_BANNED(3);
private final int order;
user_type(int order) {
this.order = order;
}
public int getOrder() {
return this.order;
}
}
...
@Override
public int compareTo(final myRow another) {
if (sorttype==sort_type.SORT_ABC) {
if (this.getUserType().equals(another.getUserType())) {
return this.getRow().toLowerCase().compareTo(another.getRow().toLowerCase());
} else {
return this.getUserType().compareTo(another.getUserType());
}
}
else {
//LOGINTIME
return this.getUserType().compareTo(another.getUserType());
}
}
Thanks, Sanjay!