1 61 62 63 64 package org.jaxen.expr; 65 66 import org.jaxen.function.NumberFunction; 67 68 class DefaultEqualsExpr extends DefaultEqualityExpr 69 { 70 DefaultEqualsExpr( 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 "[(DefaultEqualsExpr): " + getLHS() + ", " + getRHS() + "]"; 83 } 84 85 protected boolean evaluateObjectObject( Object lhs, Object rhs ) 86 { 87 if( eitherIsNumber( lhs, rhs ) ) 88 { 89 if( NumberFunction.isNaN( (Double ) lhs ) || NumberFunction.isNaN( (Double ) rhs ) ) 90 { 91 return false; 92 } 93 } 94 95 return lhs.equals( rhs ); 96 } 97 public void accept(Visitor visitor) 98 { 99 visitor.visit(this); 100 } 101 } 102 | Popular Tags |