public class SpellLevelComparator extends java.lang.Object implements java.util.Comparator<Spell>
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. I.e. if the two compared spells have the same level 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 SpellLevelComparator object.
|Modifier and Type||Method and Description|
Compares its two arguments for order according to their levels
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SpellLevelComparator(java.util.Comparator<? super Spell> sameLevelSubComparator)
sameLevelSubComparator- if two spells with the same level are compared, this sub-comparator is applied if it is not null.