Exemple #1
0
 /**
  * Checks if the items can be compared. Items are comparable
  *
  * @param b second item
  * @return result of check
  */
 public final boolean comparable(final Item b) {
   return type == b.type
       || num() && b.num()
       || (unt() || str()) && (b.str() || b.unt())
       || dur() && b.dur()
       || func();
 }
Exemple #2
0
  /**
   * Checks the items for equivalence.
   *
   * @param ii input info
   * @param it item to be compared
   * @return result of check
   * @throws QueryException query exception
   */
  public final boolean equiv(final InputInfo ii, final Item it) throws QueryException {

    // check if both values are NaN, or if values are equal..
    return (this == Dbl.NAN || this == Flt.NAN) && it.num() && Double.isNaN(it.dbl(ii))
        || comparable(it) && eq(ii, it);
  }