当前位置: 首页>>代码示例>>Java>>正文


Java ArrayIterator类代码示例

本文整理汇总了Java中net.sf.saxon.tree.iter.ArrayIterator的典型用法代码示例。如果您正苦于以下问题:Java ArrayIterator类的具体用法?Java ArrayIterator怎么用?Java ArrayIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ArrayIterator类属于net.sf.saxon.tree.iter包,在下文中一共展示了ArrayIterator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterateAxis

import net.sf.saxon.tree.iter.ArrayIterator; //导入依赖的package包/类
/**
 * Determines axis iteration algorithm. Throws {@code UnsupportedOperationException} in case,
 * when there is no axis iterator for given axisNumber.
 * @param axisNumber element from {@code AxisInfo}
 * @return {@code AxisIterator} object
 */
@Override
public AxisIterator iterateAxis(byte axisNumber) {
    final AxisIterator result;
    switch (axisNumber) {
        case AxisInfo.ANCESTOR:
        case AxisInfo.ATTRIBUTE:
        case AxisInfo.PARENT:
            result = EmptyIterator.OfNodes.THE_INSTANCE;
            break;
        case AxisInfo.ANCESTOR_OR_SELF:
        case AxisInfo.SELF:
            result = SingleNodeIterator.makeIterator(this);
            break;
        case AxisInfo.CHILD:
            if (hasChildNodes()) {
                result = new ArrayIterator.OfNodes(
                        getChildren().toArray(new AbstractNode[getChildren().size()]));
            }
            else {
                result = EmptyIterator.OfNodes.THE_INSTANCE;
            }
            break;
        case AxisInfo.DESCENDANT:
            if (hasChildNodes()) {
                result = new Navigator.DescendantEnumeration(this, false, true);
            }
            else {
                result = EmptyIterator.OfNodes.THE_INSTANCE;
            }
            break;
        case AxisInfo.DESCENDANT_OR_SELF:
            result = new Navigator.DescendantEnumeration(this, true, true);
            break;
        default:
            throw throwUnsupportedOperationException();
    }
    return result;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:45,代码来源:RootNode.java

示例2: iterateAxis

import net.sf.saxon.tree.iter.ArrayIterator; //导入依赖的package包/类
/**
 * Determines axis iteration algorithm. Throws {@code UnsupportedOperationException} in case,
 * when there is no axis iterator for given axisNumber.
 *
 * @param axisNumber element from {@code AxisInfo}
 * @return {@code AxisIterator} object
 */
@Override
public AxisIterator iterateAxis(byte axisNumber) {
    final AxisIterator result;
    switch (axisNumber) {
        case AxisInfo.ANCESTOR:
            result = new Navigator.AncestorEnumeration(this, false);
            break;
        case AxisInfo.ANCESTOR_OR_SELF:
            result = new Navigator.AncestorEnumeration(this, true);
            break;
        case AxisInfo.ATTRIBUTE:
            if (attributes == null) {
                result = EmptyIterator.OfNodes.THE_INSTANCE;
            }
            else {
                result = new ArrayIterator.OfNodes(attributes);
            }
            break;
        case AxisInfo.CHILD:
            if (hasChildNodes()) {
                result = new ArrayIterator.OfNodes(
                        getChildren().toArray(new AbstractNode[getChildren().size()]));
            }
            else {
                result = EmptyIterator.OfNodes.THE_INSTANCE;
            }
            break;
        case AxisInfo.DESCENDANT:
            if (hasChildNodes()) {
                result = new Navigator.DescendantEnumeration(this, false, true);
            }
            else {
                result = EmptyIterator.OfNodes.THE_INSTANCE;
            }
            break;
        case AxisInfo.DESCENDANT_OR_SELF:
            result = new Navigator.DescendantEnumeration(this, true, true);
            break;
        case AxisInfo.PARENT:
            result = SingleNodeIterator.makeIterator(parent);
            break;
        case AxisInfo.SELF:
            result = SingleNodeIterator.makeIterator(this);
            break;
        default:
            throw throwUnsupportedOperationException();
    }
    return result;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:57,代码来源:ElementNode.java

示例3: newIterator

import net.sf.saxon.tree.iter.ArrayIterator; //导入依赖的package包/类
public SequenceIterator newIterator() throws HttpClientException {
  Item[] array = myItems.toArray(new Item[0]);
  return new ArrayIterator(array);
}
 
开发者ID:Armatiek,项目名称:xslweb,代码行数:5,代码来源:SaxonResult.java


注:本文中的net.sf.saxon.tree.iter.ArrayIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。