public class UnitSkillComparator extends java.lang.Object implements java.util.Comparator<Unit>
Note: this comparator imposes orderings that are inconsistent with equals.
In order to overcome the inconsistency with equals this comparator allows the introduction of a sub-comparator which is applied in cases of equality.
|Constructor and Description|
Creates a new UnitSkillComparator object.
|Modifier and Type||Method and Description|
Compares its two arguments for order according to their skills.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public UnitSkillComparator(java.util.Comparator<? super java.util.Map<? extends ID,Skill>> skillsComparator, java.util.Comparator<? super Unit> subComparator)
skillsComparator- used to compare the skills of two units
subComparator- if two units do not possess skills or if the skills comparator regards them as equal, this sub-comparator is applied if it is not null.