1 61 62 63 64 package org.jaxen.expr; 65 66 import org.jaxen.function.NumberFunction; 67 68 class DefaultNotEqualsExpr extends DefaultEqualityExpr 69 { 70 DefaultNotEqualsExpr( Expr lhs, Expr rhs ) 71 { 72 super( lhs, rhs ); 73 } 74 75 public String getOperator() 76 { 77 return "!="; 78 } 79 80 public String toString() 81 { 82 return "[(DefaultNotEqualsExpr): " + getLHS() + ", " + getRHS() + "]"; 83 } 84 85 protected boolean evaluateObjectObject( Object lhs, Object rhs ) 86 { 87 if( eitherIsNumber( lhs, rhs ) ) 88 { 89 90 if( NumberFunction.isNaN( (Double ) lhs ) || NumberFunction.isNaN( (Double ) rhs ) ) 91 { 92 return true; 93 } 94 95 } 96 return !lhs.equals( rhs ); 97 } 98 99 public void accept(Visitor visitor) 100 { 101 visitor.visit(this); 102 } 103 } 104 | Popular Tags |