/** * Ask whether a particular "special property" is present for this expression * @param property the property in question, as an integer code in the {@link StaticProperty} class * @return true if the given property is present */ public boolean hasSpecialProperty(int property) { return (getSpecialProperties() & property) != 0; }
/** * Get the static properties of this expression (other than its type). The result is * bit-significant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. * @param arguments the actual arguments to the function call */ public int getSpecialProperties(Expression[] arguments) { return arguments[0].getSpecialProperties(); }
/** * Get the static properties of this expression (other than its type). The result is * bit-significant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. * @param arguments the actual arguments to the function call */ public int getSpecialProperties(Expression[] arguments) { return arguments[0].getSpecialProperties(); }
/** * Get the static properties of this expression (other than its type). The result is * bit-significant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. * @param arguments the actual arguments */ public int getSpecialProperties(Expression[] arguments) { return arguments[0].getSpecialProperties(); }
/** * Determine whether this instruction creates new nodes. * * */ public final boolean createsNewNodes() { return (child.getSpecialProperties() & StaticProperty.NON_CREATIVE) == 0; }
/** * Determine whether this instruction creates new nodes. * This implementation returns true if the "action" creates new nodes. * (Nodes created by the condition can't contribute to the result). */ public final boolean createsNewNodes() { int props = action.getSpecialProperties(); return ((props & StaticProperty.NON_CREATIVE) == 0); }
/** * Determine whether this instruction creates new nodes. * This implementation returns true if the "action" creates new nodes. * (Nodes created by the condition can't contribute to the result). */ public final boolean createsNewNodes() { return (action.getSpecialProperties() & finallyExp.getSpecialProperties() & StaticProperty.NON_CREATIVE) == 0; }
/** * Get the static properties of this expression (other than its type). The result is * bit-signficant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. */ public int computeSpecialProperties() { return operand.getSpecialProperties(); }
/** * Determine whether this instruction creates new nodes. * This implementation returns true if the "action" creates new nodes. * (Nodes created by the condition can't contribute to the result). */ public final boolean mayCreateNewNodes() { int props = getActionExpression().getSpecialProperties(); return (props & StaticProperty.NO_NODES_NEWLY_CREATED) == 0; }
/** * Determine whether this instruction creates new nodes. * This implementation returns true if the "action" creates new nodes. * (Nodes created by the condition can't contribute to the result). */ public final boolean mayCreateNewNodes() { int props = getAction().getSpecialProperties(); return (props & StaticProperty.NO_NODES_NEWLY_CREATED) == 0; }
/** * Get the static properties of this expression (other than its type). The result is * bit-signficant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. */ public int computeSpecialProperties() { return getBaseExpression().getSpecialProperties(); }
/** * Get the static properties of this expression (other than its type). The result is * bit-signficant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. */ public int computeSpecialProperties() { return getBaseExpression().getSpecialProperties(); }
/** * Determine whether this instruction creates new nodes. * This implementation returns true if the "action" creates new nodes. * (Nodes created by the condition can't contribute to the result). */ public final boolean mayCreateNewNodes() { int props = getAction().getSpecialProperties(); return (props & StaticProperty.NO_NODES_NEWLY_CREATED) == 0; }
/** * Get the static properties of this expression (other than its type). The result is * bit-significant. These properties are used for optimizations. In general, if * property bit is set, it is true, but if it is unset, the value is unknown. * * @return the static properties of the expression, as a bit-significant value */ public int computeSpecialProperties() { return getBase().getSpecialProperties(); }
/** * Determine whether this instruction creates new nodes. * This implementation returns true if the "action" creates new nodes. * (Nodes created by the condition can't contribute to the result). */ public final boolean mayCreateNewNodes() { return (getActionExpression().getSpecialProperties() & getOnCompletion().getSpecialProperties() & StaticProperty.NO_NODES_NEWLY_CREATED) == 0; }
public DocumentSorter(Expression base) { super(base); int props = base.getSpecialProperties(); if (((props & StaticProperty.CONTEXT_DOCUMENT_NODESET) != 0) || (props & StaticProperty.SINGLE_DOCUMENT_NODESET) != 0) { comparer = LocalOrderComparer.getInstance(); } else { comparer = GlobalOrderComparer.getInstance(); } }
@Override public void refineVariableType(ExpressionVisitor visitor, List<VariableReference> references, Expression returnExpr) { ItemType actualItemType = getSequence().getItemType(); if (actualItemType instanceof ErrorType) { actualItemType = AnyItemType.getInstance(); } for (VariableReference ref : references) { ref.refineVariableType(actualItemType, allowsEmpty ? StaticProperty.ALLOWS_ZERO_OR_ONE : StaticProperty.EXACTLY_ONE, null, getSequence().getSpecialProperties()); } }
private boolean mayInvolveCastToQName(TypeHierarchy th, Expression e1, Expression e2) { SimpleType s1 = (SimpleType) e1.getItemType().getAtomizedItemType(); return (s1 == BuiltInAtomicType.ANY_ATOMIC || s1.isNamespaceSensitive()) && th.relationship(e2.getItemType().getAtomizedItemType(), BuiltInAtomicType.UNTYPED_ATOMIC) != TypeHierarchy.DISJOINT && (e2.getSpecialProperties() & StaticProperty.NOT_UNTYPED_ATOMIC) == 0; }
@Override public void refineVariableType(ExpressionVisitor visitor, List<VariableReference> references, Expression returnExpr) { final Expression seq = getSequence(); final ItemType actualItemType = seq.getItemType(); for (VariableReference ref : references) { ref.refineVariableType(actualItemType, getSequence().getCardinality(), seq instanceof Literal ? ((Literal) seq).getValue() : null, seq.getSpecialProperties()); ExpressionTool.resetStaticProperties(returnExpr); } }
@Override public void refineVariableType(ExpressionVisitor visitor, List<VariableReference> references, Expression returnExpr) { final ItemType actualItemType = getPredicate().getItemType(); for (VariableReference ref : references) { ref.refineVariableType(actualItemType, getPredicate().getCardinality(), getPredicate() instanceof Literal ? ((Literal) getPredicate()).getValue() : null, getPredicate().getSpecialProperties()); ExpressionTool.resetStaticProperties(returnExpr); } }