Class InverseComparator<T1,​T2>

java.lang.Object
ch.njol.skript.classes.InverseComparator<T1,​T2>
All Implemented Interfaces:
Comparator<T1,​T2>

public class InverseComparator<T1,​T2> extends Object implements Comparator<T1,​T2>
  • Constructor Details

    • InverseComparator

      public InverseComparator(Comparator<? super T2,​? super T1> c)
  • Method Details

    • compare

      public Comparator.Relation compare(T1 o1, T2 o2)
      Description copied from interface: Comparator
      Compares the given objects which may not be null. Returning GREATER/SMALLER means that the first parameter is greater/smaller.
      Specified by:
      compare in interface Comparator<T1,​T2>
      Parameters:
      o1 - Non-null object
      o2 - Non-null object
      Returns:
      the relation of the objects. Should neither return GREATER_OR_EQUAL nor SMALLER_OR_EQUAL.
    • supportsOrdering

      public boolean supportsOrdering()
      Specified by:
      supportsOrdering in interface Comparator<T1,​T2>
      Returns:
      whether this comparator supports ordering of elements or not.
    • toString

      public String toString()
      Overrides:
      toString in class Object