public int compareTo(Object arg0) {
		DataRow row = (DataRow) arg0;
		DataHeader header = getTable().getHeader();
		DataColumn column;
		int result = 0;

		if (header.isDefaultSort()) {
			for (int i = 0; i < header.getColumnCount(); i++) {
				column = header.getColumn(i);
				if (column.isSorted()) {
					result = header.compareColumnValues(i, column.isSortDescending(), getValue(i), row.getValue(i));
					if (result != 0)
						break;
				}
			}
		} else {
			column = header.getResortedColumn();
			int i = column.getPosition();
			result = header.compareColumnValues(i, column.isResortedDescending(), getValue(i), row.getValue(i));
			if (result == 0 && column.isSecondaryResort()) {
				boolean secondaryResortDescending = column.isSecondaryResortDescending();
				i = column.getSecondaryResortColumnIndex();
				column = header.getColumn(i);
				if (column != null) {
					result = header.compareColumnValues(i, secondaryResortDescending, getValue(i), row.getValue(i));
				}
			}
		}
		return result;
	}