/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
/** * Apply the operation to two operands, and return the result. * * * @param left non-null reference to the evaluated left operand. * @param right non-null reference to the evaluated right operand. * * @return non-null reference to the XObject that represents the result of the operation. * * @throws javax.xml.transform.TransformerException */ public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
/** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if(!isSameClass(expr)) return false; // If equals at the expression level calls deepEquals, I think we're // still safe from infinite recursion since this object overrides // equals. I hope. if(!this.equals((XObject)expr)) return false; return true; }
/** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if(!isSameClass(expr)) return false; // If equals at the expression level calls deepEquals, I think we're // still safe from infinite recursion since this object overrides // equals. I hope. if(!this.equals((XObject)expr)) return false; return true; }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare this to * * @return True if this object is equal to the given object * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); if (null != m_obj) { return m_obj.equals(obj2.m_obj); } else { return obj2.m_obj == null; } }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare this to * * @return True if this object is equal to the given object * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); if (null != m_obj) { return m_obj.equals(obj2.m_obj); } else { return obj2.m_obj == null; } }
/** * Tell if two objects are functionally not equal. * * @param obj2 Object to compare this to * * @return True if this object is not equal to the given object * * @throws javax.xml.transform.TransformerException */ public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.notEquals(this); return !equals(obj2); }
/** * Tell if two objects are functionally not equal. * * @param obj2 Object to compare this to * * @return True if this object is not equal to the given object * * @throws javax.xml.transform.TransformerException */ public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.notEquals(this); return !equals(obj2); }
return obj2.equals(this);
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare to this * * @return True if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
return obj2.equals(this);
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare to this * * @return True if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
/** * Execute a binary operation by calling execute on each of the operands, * and then calling the operate method on the derived class. * * * @param xctxt The runtime execution context. * * @return The XObject result of the operation. * * @throws javax.xml.transform.TransformerException */ public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject left = m_left.execute(xctxt, true); XObject right = m_right.execute(xctxt, true); boolean result = left.equals(right) ? true : false; left.detach(); right.detach(); return result; }
/** * Execute a binary operation by calling execute on each of the operands, * and then calling the operate method on the derived class. * * * @param xctxt The runtime execution context. * * @return The XObject result of the operation. * * @throws javax.xml.transform.TransformerException */ public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject left = m_left.execute(xctxt, true); XObject right = m_right.execute(xctxt, true); boolean result = left.equals(right) ? true : false; left.detach(); right.detach(); return result; }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare this to * * @return true if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (t == XObject.CLASS_NODESET) return obj2.equals(this); else if(t == XObject.CLASS_BOOLEAN) return obj2.bool() == bool(); else return m_val == obj2.num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
/** * Tell if two objects are functionally equal. * * @param obj2 Object to compare this to * * @return true if the two objects are equal * * @throws javax.xml.transform.TransformerException */ public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (t == XObject.CLASS_NODESET) return obj2.equals(this); else if(t == XObject.CLASS_BOOLEAN) return obj2.bool() == bool(); else return m_val == obj2.num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
return obj2.equals(this);
return obj2.equals(this);