Package ch.njol.skript.classes

Examples of ch.njol.skript.classes.Comparator


      } else {
        Skript.error("Can't compare " + f(first) + " with " + f(second) + (third == null ? "" : " and " + f(third)), ErrorQuality.NOT_AN_EXPRESSION);
        return false;
      }
    }
    @SuppressWarnings("rawtypes")
    final Comparator comp = this.comp;
    if (comp != null) {
      if (third == null) {
        if (!relation.isEqualOrInverse() && !comp.supportsOrdering()) {
          Skript.error("Can't test " + f(first) + " for being '" + relation + "' " + f(second), ErrorQuality.NOT_AN_EXPRESSION);
          return false;
        }
      } else {
        if (!comp.supportsOrdering()) {
          Skript.error("Can't test " + f(first) + " for being 'between' " + f(second) + " and " + f(third), ErrorQuality.NOT_AN_EXPRESSION);
          return false;
        }
      }
    }
View Full Code Here


 
  @SuppressWarnings({"rawtypes", "unchecked"})
  public final static Relation compare(final @Nullable Object o1, final @Nullable Object o2) {
    if (o1 == null || o2 == null)
      return Relation.NOT_EQUAL;
    @SuppressWarnings("null")
    final Comparator c = getComparator(o1.getClass(), o2.getClass());
    if (c == null)
      return Relation.NOT_EQUAL;
    return c.compare(o1, o2);
  }
View Full Code Here

TOP

Related Classes of ch.njol.skript.classes.Comparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.