/** * Evaluate the function */ public Item evaluateItem(XPathContext context) throws XPathException { return argument[0].evaluateItem(context); }
@Override public Sequence<?> evaluate(Expression expr, XPathContext context) throws XPathException { Item<?> item = expr.evaluateItem(context); return item==null ? EmptySequence.getInstance() : item; }
/** * Evaluate as an Item. */ public Item evaluateItem(XPathContext context) throws XPathException { Item item = operand.evaluateItem(context); if (item==null) return null; testConformance(item, context); return item; }
/** * Evaluate the function */ public Item evaluateItem(XPathContext c) throws XPathException { NodeInfo node = (NodeInfo)argument[0].evaluateItem(c); return getNilledProperty(node); }
@Override public Sequence<?> evaluate(Expression expr, XPathContext context) throws XPathException { Item<?> item = expr.evaluateItem(context); return item==null ? EmptySequence.getInstance() : item; }
/** * Evaluate the expression */ public Item evaluateItem(XPathContext context) throws XPathException { AtomicValue arg = (AtomicValue)argument[0].evaluateItem(context); if (arg == null) { return null; } return arg.getComponent(component); }
/** * Callback for evaluating the sort keys */ public Item evaluateSortKey(int n, XPathContext c) throws XPathException { return sortKeyDefinitions[n].getSortKey().evaluateItem(c); }
/** * Evaluate the expression. */ public Item evaluateItem(XPathContext context) throws XPathException { NumericValue v1 = (NumericValue) operand.evaluateItem(context); if (v1 == null) { return backwardsCompatible ? DoubleValue.NaN : null; } return v1.negate(); }
/** * Return an iteration over the sequence */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { IntegerValue av1 = (IntegerValue) getLhsExpression().evaluateItem(context); IntegerValue av2 = (IntegerValue) getRhsExpression().evaluateItem(context); return RangeIterator.makeRangeIterator(av1, av2); }
/** * Callback for evaluating the sort keys */ public AtomicValue evaluateSortKey(int n, XPathContext c) throws XPathException { return (AtomicValue) getSortKeyDefinition(n).getSortKey().evaluateItem(c); }
/** * Evaluate the expression. */ public NumericValue evaluateItem(XPathContext context) throws XPathException { NumericValue v1 = (NumericValue) getBaseExpression().evaluateItem(context); if (v1 == null) { return backwardsCompatible ? DoubleValue.NaN : null; } return v1.negate(); }
public SequenceIterator iterate(XPathContext c) throws XPathException { Item item = argument[0].evaluateItem(c); if (item==null) { return EmptyIterator.getInstance(); } return ((StringValue)item).iterateCharacters(); }
/** * Evaluate the function */ public Item evaluateItem(XPathContext c) throws XPathException { Item arg = argument[0].evaluateItem(c); if (arg==null) { return StringValue.EMPTY_STRING; } else { return StringValue.makeStringValue(arg.getStringValueCS()); } }
public SequenceIterator iterate(XPathContext c) throws XPathException { Item item = argument[0].evaluateItem(c); if (item==null) { return EmptyIterator.getInstance(); } return ((StringValue)item).iterateCharacters(); }
/** * Evaluate as an Item. This should only be called if the Atomizer has cardinality zero-or-one, * which will only be the case if the underlying expression has cardinality zero-or-one. */ public AtomicValue evaluateItem(XPathContext context) throws XPathException { Item i = getBaseExpression().evaluateItem(context); if (i == null) { return null; } else { return i.atomize().head(); } }
/** * Callback for evaluating the sort keys */ public AtomicValue evaluateSortKey(int n, XPathContext c) throws XPathException { return (AtomicValue) getSortKeyDefinitions().getSortKeyDefinition(n).getSortKey().evaluateItem(c); }
/** * Get the effective boolean value. In the case of a union expression, this * is reduced to an OR expression, for efficiency */ @Override public boolean effectiveBooleanValue(XPathContext c) throws XPathException { NodeInfo m = (NodeInfo) getLhsExpression().evaluateItem(c); return m != null && containsNode(getRhsExpression().iterate(c), m); }
@Override public AtomicValue evaluateItem(XPathContext context) throws XPathException { // cut out some of the call overhead Item val = getArg(0).evaluateItem(context); if (val == null) { return resultWhenEmpty().head(); } else { return evaluate(val, context); } } };
@Override public CharSequence evaluateAsString(XPathContext context) throws XPathException { FastStringBuffer buffer = new FastStringBuffer(256); for (Operand o: operands()) { Item it = o.getChildExpression().evaluateItem(context); if (it != null) { buffer.append(it.getStringValueCS()); } } return buffer; }
@Override public CharSequence evaluateAsString(XPathContext context) throws XPathException { FastStringBuffer buffer = new FastStringBuffer(256); for (Operand o: operands()) { Item it = o.getChildExpression().evaluateItem(context); if (it != null) { buffer.append(it.getStringValueCS()); } } return buffer; }