Class StaffComparator
- All Implemented Interfaces:
Serializable
,Comparator<Staff>
A Comparator for Staff Profiles.
- Since:
- 1.0
- Version:
- 8.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsFields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _typeNames
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareImpl
(Staff o1, Staff o2) Compares two Staff Profiles by the designated criteria.boolean
hasAreas()
Returns whether functional areas have been loaded.void
setAreas
(Collection<String> areas) Initializes the functional areas.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
-
AREA
public static final int AREA- See Also:
-
LASTNAME
public static final int LASTNAME- See Also:
-
TYPES
-
-
Constructor Details
-
StaffComparator
public StaffComparator(int comparisonType) Initializes the comparator.- Parameters:
comparisonType
- the comparison type code- Throws:
IllegalArgumentException
- if an invalide code is specified
-
-
Method Details
-
hasAreas
public boolean hasAreas()Returns whether functional areas have been loaded.- Returns:
- TRUE if areas are present, otherwise FALSE
-
setAreas
Initializes the functional areas.- Parameters:
areas
- an ordered Collection of area names- See Also:
-
compareImpl
Compares two Staff Profiles by the designated criteria.- Specified by:
compareImpl
in classAbstractComparator<Staff>
- Parameters:
o1
- The first object to compareo2
- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- Throws:
ClassCastException
- if either object is not a Staff- See Also:
-