Package org.exist.memtree

Examples of org.exist.memtree.NodeImpl$SingleNodeIterator


    public Sequence getAncestors(boolean includeSelf, NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectAncestors(includeSelf, test, nodes);
        }
        return nodes;
    }
View Full Code Here


    public Sequence getParents(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            final NodeImpl parent = (NodeImpl) node.selectParentNode();
            if (parent != null && test.matches(parent))
                {nodes.add(parent);}
        }
        return nodes;
    }
View Full Code Here

    public Sequence getSelf(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            if ((test.getType() == Type.NODE && node.getNodeType() == Node.ATTRIBUTE_NODE) ||
                    test.matches(node))
                {nodes.add(node);}
        }
        return nodes;
    }
View Full Code Here

    public Sequence getPrecedingSiblings(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectPrecedingSiblings(test, nodes);
        }
        return nodes;
    }
View Full Code Here

    public Sequence getPreceding(NodeTest test, int position) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectPreceding(test, nodes, position);
        }
        return nodes;
    }
View Full Code Here

    public Sequence getFollowingSiblings(NodeTest test) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectFollowingSiblings(test, nodes);
        }
        return nodes;
    }
View Full Code Here

    public Sequence getFollowing(NodeTest test, int position) throws XPathException {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            node.selectFollowing(test, nodes, position);
        }
        return nodes;
    }
View Full Code Here

    public Sequence selectDescendants(MemoryNodeSet descendants) {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            for (int j = 0; j < descendants.size(); j++) {
                final NodeImpl descendant = descendants.get(j);
                if (descendant.getNodeId().isDescendantOrSelfOf(node.getNodeId()))
                    {nodes.add(node);}
            }
        }
        return nodes;
    }
View Full Code Here

    public Sequence selectChildren(MemoryNodeSet children) {
        sortInDocumentOrder();
        final ValueSequence nodes = new ValueSequence(true);
        nodes.keepUnOrdered(keepUnOrdered);
        for (int i = 0; i <= size; i++) {
            final NodeImpl node = (NodeImpl) values[i];
            for (int j = 0; j < children.size(); j++) {
                final NodeImpl descendant = children.get(j);
                if (descendant.getNodeId().isChildOf(node.getNodeId()))
                    {nodes.add(node);}
            }
        }
        return nodes;
    }
View Full Code Here

  public boolean matchSelf(NodeTest test) throws XPathException {
    //UNDERSTAND: is it required? -shabanovd
    sortInDocumentOrder();
    for (int i = 0; i <= size; i++) {
      final NodeImpl node = (NodeImpl) values[i];
      if ((test.getType() == Type.NODE && node.getNodeType() == Node.ATTRIBUTE_NODE) ||
          test.matches(node))
        {return true;}
      }
    return false;
  }
View Full Code Here

TOP

Related Classes of org.exist.memtree.NodeImpl$SingleNodeIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.