コード例 #1
0
  public int sort(SalesByCustomerDetail obj1, SalesByCustomerDetail obj2, int col) {

    int ret = obj1.getName().toLowerCase().compareTo(obj2.getName().toLowerCase());
    if (ret != 0) {
      return ret;
    }
    switch (col) {
      case 2:
        return UIUtils.compareInt(obj1.getType(), obj2.getType());
      case 1:
        return obj1.getDate().compareTo(obj2.getDate());
      case 3:
        return UIUtils.compareInt(
            Integer.parseInt(obj1.getNumber()), Integer.parseInt(obj2.getNumber()));
      case 0:
        return obj1.getName().toLowerCase().compareTo(obj2.getName().toLowerCase());
      case 4:
        return obj1.getDueDate().compareTo(obj2.getDueDate());
      case 5:
        return UIUtils.compareDouble(obj1.getAmount(), obj2.getAmount());
    }
    return 0;
  }
コード例 #2
0
 @Override
 public Object getColumnData(SalesByCustomerDetail record, int columnIndex) {
   switch (columnIndex) {
     case 2:
       return Utility.getTransactionName(record.getType());
     case 1:
       return getDateByCompanyType(record.getDate());
     case 3:
       return record.getNumber();
     case 0:
       return "";
       // case 4:
       // return record.getDueDate();
     case 4:
       return record.getAmount();
   }
   return null;
 }