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

UnaryOperation

public abstract class UnaryOperation extends Expression implements ExpressionOwner
The unary operation base class.

Fields Summary
protected Expression
m_right
The operand for the operation.
Constructors Summary
Methods Summary
public voidcallVisitors(com.sun.org.apache.xpath.internal.ExpressionOwner owner, com.sun.org.apache.xpath.internal.XPathVisitor visitor)

see
XPathVisitable#callVisitors(XPathVisitor)

  	if(visitor.visitUnaryOperation(owner, this))
  	{
  		m_right.callVisitors(this, visitor);
  	}
  
public booleancanTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.

return
true if traversal outside the context node's subtree can occur.


    if (null != m_right && m_right.canTraverseOutsideSubtree())
      return true;

    return false;
  
public booleandeepEquals(com.sun.org.apache.xpath.internal.Expression expr)

see
Expression#deepEquals(Expression)

  	if(!isSameClass(expr))
  		return false;
  		
  	if(!m_right.deepEquals(((UnaryOperation)expr).m_right))
  		return false;
  		
  	return true;
  
public com.sun.org.apache.xpath.internal.objects.XObjectexecute(com.sun.org.apache.xpath.internal.XPathContext xctxt)
Execute the operand and apply the unary operation to the result.

param
xctxt The runtime execution context.
return
An XObject that represents the result of applying the unary operation to the evaluated operand.
throws
javax.xml.transform.TransformerException


    return operate(m_right.execute(xctxt));
  
public voidfixupVariables(java.util.Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

param
vars List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).

    m_right.fixupVariables(vars, globalsSize);
  
public com.sun.org.apache.xpath.internal.ExpressiongetExpression()

see
ExpressionOwner#getExpression()

    return m_right;
  
public com.sun.org.apache.xpath.internal.ExpressiongetOperand()

return
the operand of unary operation, as an Expression.

    return m_right;
  
public abstract com.sun.org.apache.xpath.internal.objects.XObjectoperate(com.sun.org.apache.xpath.internal.objects.XObject right)
Apply the operation to two operands, and return the result.

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 voidsetExpression(com.sun.org.apache.xpath.internal.Expression exp)

see
ExpressionOwner#setExpression(Expression)

  	exp.exprSetParent(this);
  	m_right = exp;
  
public voidsetRight(com.sun.org.apache.xpath.internal.Expression r)
Set the expression operand for the operation.

param
r The expression operand to which the unary operation will be applied.

    m_right = r;
    r.exprSetParent(this);