market.swing
Class CmpCustomersNumbers
java.lang.Object
|
+--market.swing.CmpCustomersNumbers
- All Implemented Interfaces:
- Comparator, Serializable
- public class CmpCustomersNumbers
- extends Object
- implements Comparator, Serializable
Compares UCustomers
by special criteria.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISCOUNT
public static final int DISCOUNT
- See Also:
- Constant Field Values
SALES_VOLUME
public static final int SALES_VOLUME
- See Also:
- Constant Field Values
CmpCustomersNumbers
public CmpCustomersNumbers(int option)
- Parameters:
option
- - 0: Users are compared by their discount
- 1: Users are compared by their volume of sales
compare
public int compare(Object o1,
Object o2)
- The actual comparison.
- Specified by:
compare
in interface Comparator
- Parameters:
o1
- the first customer.o2
- the second customer.
- Returns:
- an int representing the result of the comparison.