Class EquipmentComparator
java.lang.Object
org.deltava.comparators.AbstractComparator<EquipmentType>
org.deltava.comparators.EquipmentComparator
- All Implemented Interfaces:
Serializable
,Comparator<EquipmentType>
A comparator for EquipmentType beans.
- Since:
- 1.0
- Version:
- 7.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsFields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _typeNames
-
Constructor Summary
ConstructorsConstructorDescriptionEquipmentComparator
(int comparisonType) Creates a new EquipmentComparator with a given comparison type.EquipmentComparator
(String comparisonType) Creates a new EquipmentComparator with a given comparison type. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareImpl
(EquipmentType et1, EquipmentType et2) Compares two equipment programs by the designated criteria.Methods inherited from class org.deltava.comparators.AbstractComparator
compare, getComparisonType, getTypeNames, setComparisonType, setComparisonType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
STAGE
public static final int STAGE- See Also:
-
NAME
public static final int NAME- See Also:
-
-
Constructor Details
-
EquipmentComparator
public EquipmentComparator(int comparisonType) Creates a new EquipmentComparator with a given comparison type.- Parameters:
comparisonType
- The criteria by which to compare- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
EquipmentComparator
Creates a new EquipmentComparator with a given comparison type.- Parameters:
comparisonType
- The criteria type name by which to compare- Throws:
IllegalArgumentException
- if the type name is invalid- See Also:
-
-
Method Details
-
compareImpl
Compares two equipment programs by the designated criteria.- Specified by:
compareImpl
in classAbstractComparator<EquipmentType>
- Parameters:
et1
- The first object to compareet2
- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- Throws:
ClassCastException
- if either object is not an EquipmentType- See Also:
-