public class SkillByTypeComparator extends java.lang.Object implements java.util.Comparator<Skill>
Note: this comparator can impose 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. I.e. if the two compared objects have the same type and they would be regarded as equal by this comparator, instead of 0 the result of the sub-comparator's comparison is returned.
|Constructor and Description|
Creates a new SkillTypeComparator object.
|Modifier and Type||Method and Description|
Compares its two arguments for order according to their types.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SkillByTypeComparator(java.util.Comparator<? super SkillType> typeComparator, java.util.Comparator<? super Skill> subComparator)
typeComparator- used to compare the types of skills.
subComparator- if the typeComparator's comparison of the skill types yields 0, this sub-comparator is applied to the skill objects if it is not null.
s1- an instance of class Skill.
s2- an instance of class Skill.