private static Selector simplifyNE(Selector sel0, Selector sel1) {
    if (sel0.getType() == Selector.BOOLEAN)
      return makeOR(makeAND(simplifyTree(sel0), simplifyNOT(sel1)),
                    makeAND(simplifyNOT(sel0), simplifyTree(sel1)));
    else if (sel0.getType() == Selector.STRING || sel0.getType() == Selector.UNKNOWN)
      return new OperatorImpl(Selector.NE, sel0, sel1);
    else
      // Numeric: transform into a pair of inequalities
      return makeOR(new OperatorImpl(Selector.LT, sel0, sel1),
                    new OperatorImpl(Selector.GT, sel0, sel1));
  }
private static Selector simplifyNE ( Selector sel0 , Selector sel1 ) { if ( sel0 . getType ( ) == Selector . BOOLEAN ) return makeOR ( makeAND ( simplifyTree ( sel0 ) , simplifyNOT ( sel1 ) ) , makeAND ( simplifyNOT ( sel0 ) , simplifyTree ( sel1 ) ) ) ; else if ( sel0 . getType ( ) == Selector . STRING || sel0 . getType ( ) == Selector . UNKNOWN ) return new OperatorImpl ( Selector . NE , sel0 , sel1 ) ; else return makeOR ( new OperatorImpl ( Selector . LT , sel0 , sel1 ) , new OperatorImpl ( Selector . GT , sel0 , sel1 ) ) ; }
Subroutine of simplifyTree to handle NE nodes