gpt4 book ai didi

net.sf.saxon.expr.XPathContextMajor.getTailCallFunction()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 19:53:40 24 4
gpt4 key购买 nike

本文整理了Java中net.sf.saxon.expr.XPathContextMajor.getTailCallFunction()方法的一些代码示例,展示了XPathContextMajor.getTailCallFunction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathContextMajor.getTailCallFunction()方法的具体详情如下:
包路径:net.sf.saxon.expr.XPathContextMajor
类名称:XPathContextMajor
方法名:getTailCallFunction

XPathContextMajor.getTailCallFunction介绍

[英]Determine whether the body of a function is to be repeated, due to tail-recursive function calls
[中]确定函数体是否由于尾部递归函数调用而重复

代码示例

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
* Evaluate as an Item.
*/
public Item evaluateItem(XPathContext context) throws XPathException {
  final XPathContextMajor cm = (XPathContextMajor)context;
  while (true) {
    Item item = operand.evaluateItem(context);
    UserFunction fn = cm.getTailCallFunction();
    if (fn == null) {
      return item;
    }
    if (fn != containingFunction) {
      return Value.asItem(tailCallDifferentFunction(fn, cm));
    }
    // otherwise, loop round to execute the tail call
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
* Evaluate as an Item.
*/
public Item evaluateItem(XPathContext context) throws XPathException {
  final XPathContextMajor cm = (XPathContextMajor)context;
  while (true) {
    Item item = operand.evaluateItem(context);
    UserFunction fn = cm.getTailCallFunction();
    if (fn == null) {
      return item;
    }
    if (fn != containingFunction) {
      return Value.asItem(tailCallDifferentFunction(fn, cm));
    }
    // otherwise, loop round to execute the tail call
  }
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Process the function body
 * @param context The dynamic context, giving access to the current node,
 *                the current variables, etc.
 */
public void process(XPathContext context) throws XPathException {
  final XPathContextMajor cm = (XPathContextMajor)context;
  while (true) {
    operand.process(context);
    UserFunction fn = cm.getTailCallFunction();
    if (fn == null) {
      return;
    }
    if (fn != containingFunction) {
      Value.asValue(tailCallDifferentFunction(fn, cm)).process(cm);
      return;
    }
    // otherwise, loop round to execute the tail call
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Process the function body
 * @param context The dynamic context, giving access to the current node,
 *                the current variables, etc.
 */
public void process(XPathContext context) throws XPathException {
  final XPathContextMajor cm = (XPathContextMajor)context;
  while (true) {
    operand.process(context);
    UserFunction fn = cm.getTailCallFunction();
    if (fn == null) {
      return;
    }
    if (fn != containingFunction) {
      Value.asValue(tailCallDifferentFunction(fn, cm)).process(cm);
      return;
    }
    // otherwise, loop round to execute the tail call
  }
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
* Iterate over the sequence of values
*/
public SequenceIterator iterate(XPathContext context) throws XPathException {
  final XPathContextMajor cm = (XPathContextMajor)context;
  while (true) {
    SequenceIterator iter = operand.iterate(cm);
    ValueRepresentation extent = SequenceExtent.makeSequenceExtent(iter);
    UserFunction fn = cm.getTailCallFunction();
    if (fn == null) {
      return Value.asIterator(extent);
    }
    if (fn != containingFunction) {
      return Value.asIterator(tailCallDifferentFunction(fn, cm));
    }
    // otherwise, loop round to execute the tail call
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
* Iterate over the sequence of values
*/
public SequenceIterator iterate(XPathContext context) throws XPathException {
  final XPathContextMajor cm = (XPathContextMajor)context;
  while (true) {
    SequenceIterator iter = operand.iterate(cm);
    ValueRepresentation extent = SequenceExtent.makeSequenceExtent(iter);
    UserFunction fn = cm.getTailCallFunction();
    if (fn == null) {
      return Value.asIterator(extent);
    }
    if (fn != containingFunction) {
      return Value.asIterator(tailCallDifferentFunction(fn, cm));
    }
    // otherwise, loop round to execute the tail call
  }
}

代码示例来源:origin: net.sourceforge.saxon/saxon

UserFunction fn = c2.getTailCallFunction();
if (fn == null) {

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com