Class SkillTypeComparator

  • All Implemented Interfaces:
    java.util.Comparator<SkillType>

    @Deprecated
    public class SkillTypeComparator
    extends java.lang.Object
    implements java.util.Comparator<SkillType>
    Deprecated.
    completely pointless
    A comparator imposing an ordering on SkillTypes.

    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.

    Author:
    Ulrich Küster
    • Constructor Summary

      Constructors 
      Constructor Description
      SkillTypeComparator​(java.util.Comparator<? super SkillType> typeComparator, java.util.Comparator<? super SkillType> subComparator)
      Deprecated.
      Creates a new SkillTypeComparator object.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int compare​(SkillType s1, SkillType s2)
      Deprecated.
      Compares its two arguments for order according to their types.
      • 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
    • Constructor Detail

      • SkillTypeComparator

        public SkillTypeComparator​(java.util.Comparator<? super SkillType> typeComparator,
                                   java.util.Comparator<? super SkillType> subComparator)
        Deprecated.
        Creates a new SkillTypeComparator object.
        Parameters:
        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.
    • Method Detail

      • compare

        public int compare​(SkillType s1,
                           SkillType s2)
        Deprecated.
        Compares its two arguments for order according to their types.
        Specified by:
        compare in interface java.util.Comparator<SkillType>
        Parameters:
        s1 - an instance of class Skill.
        s2 - an instance of class Skill.
        Returns:
        the result of the type comparator's comparison of the skill object types. If this result is 0 and a subcomparator is specified that subcomparator is applied on the skill objects.