FileDocCategorySizeDatePackage
Or.javaAPI DocJava SE 5 API2137Fri Aug 26 14:56:10 BST 2005com.sun.org.apache.xpath.internal.operations

Or

public class Or extends Operation
The 'or' operation expression executer.

Fields Summary
Constructors Summary
Methods Summary
public booleanbool(com.sun.org.apache.xpath.internal.XPathContext xctxt)
Evaluate this operation directly to a boolean.

param
xctxt The runtime execution context.
return
The result of the operation as a boolean.
throws
javax.xml.transform.TransformerException

    return (m_left.bool(xctxt) || m_right.bool(xctxt));
  
public com.sun.org.apache.xpath.internal.objects.XObjectexecute(com.sun.org.apache.xpath.internal.XPathContext xctxt)
OR two expressions and return the boolean result. Override superclass method for optimization purposes.

param
xctxt The runtime execution context.
return
{@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_TRUE} or {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_FALSE}.
throws
javax.xml.transform.TransformerException


    XObject expr1 = m_left.execute(xctxt);

    if (!expr1.bool())
    {
      XObject expr2 = m_right.execute(xctxt);

      return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
    }
    else
      return XBoolean.S_TRUE;