34 ITEM_WEIGHT_COMPARATOR,
35 SHOP_VALUE_COMPARATOR,
37 ITEM_AMOUNT_COMPARATOR;
40 public int compare(Item first, Item second) {
41 double firstValue = 0;
42 double secondValue = 0;
44 if (first ==
null && second ==
null) {
58 case HIGH_ALCH_COMPARATOR:
63 case ITEM_AMOUNT_COMPARATOR:
64 firstValue = first.getAmount();
65 secondValue = second.getAmount();
68 case ITEM_ID_COMPARATOR:
69 firstValue = first.getId();
70 secondValue = second.getId();
73 case ITEM_WEIGHT_COMPARATOR:
74 firstValue = first.getWeight();
75 secondValue = second.getWeight();
78 case LOW_ALCH_COMPARATOR:
79 firstValue = first.getLowAlch();
80 secondValue = second.getLowAlch();
83 case SHOP_VALUE_COMPARATOR:
90 return Integer.signum((
int) (secondValue - firstValue));