Package org.exist.memtree

Examples of org.exist.memtree.NodeImpl


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


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

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

  }

    private static class InMemoryNodeComparator implements Comparator<Item> {

        public int compare(Item o1, Item o2) {
            final NodeImpl n1 = (NodeImpl) o1;
            final NodeImpl n2 = (NodeImpl) o2;
            final int docCmp = n1.getDocument().compareTo(n2.getDocument());
            if (docCmp == 0) {
                return n1.getNodeNumber() == n2.getNodeNumber() ? Constants.EQUAL :
                    (n1.getNodeNumber() > n2.getNodeNumber() ? Constants.SUPERIOR : Constants.INFERIOR);
            } else
                {return docCmp;}
        }
View Full Code Here

        if (newDocumentContext)
            {context.pushDocumentContext();}
        try {
            final MemTreeBuilder builder = context.getDocumentBuilder();
            final int nodeNr = builder.comment(data);
            final NodeImpl node = builder.getDocument().getNode(nodeNr);
            return node;
        } finally {
            if (newDocumentContext)
                {context.popDocumentContext();}
        }
View Full Code Here

               
              nodeNr = builder.characters(cdata);
            } else {
              nodeNr = builder.cdataSection(cdata);
            }
          final NodeImpl node = builder.getDocument().getNode(nodeNr);

            if (context.getProfiler().isEnabled())
                {context.getProfiler().end(this, "", node);}

            return node;
View Full Code Here

            // process element contents
            if(content != null) {
                content.eval(contextSequence, contextItem);
            }
            builder.endElement();
            final NodeImpl node = builder.getDocument().getNode(nodeNr);
            return node;
        } finally {
            context.popInScopeNamespaces();
            if (newDocumentContext)
                {context.popDocumentContext();}
View Full Code Here

                        if (uri != null) {
                            break;
                        }
                    }
                } else {
                    NodeImpl next = (NodeImpl) node;
                    do {
                        uri = findNamespaceURI((org.exist.memtree.ElementImpl) next, prefix);
                        if (uri != null) {
                            break;
                        } else {
                            next = (NodeImpl) next.getParentNode();
                        }
                    } while (next != null && next.getNodeType() == Node.ELEMENT_NODE);
                }

                if (uri == null && prefix != null && !"".equals(prefix)) {
                    throw new XPathException(this, ErrorCodes.FONS0004, "No namespace found for prefix. No binding for prefix '" + prefix
                                             + "' was found.", args[0]);
View Full Code Here

  }

    private void getId(Sequence result, Sequence seq, String id) throws XPathException {
        final Set<DocumentImpl> visitedDocs = new TreeSet<DocumentImpl>();
        for (final SequenceIterator i = seq.iterate(); i.hasNext();) {
            final NodeImpl v = (NodeImpl) i.nextItem();
            final DocumentImpl doc = v.getDocument();
            if (!visitedDocs.contains(doc)) {
                final NodeImpl elem = doc.selectById(id);
                if (elem != null)
                    {result.add(elem);}
                visitedDocs.add(doc);
            }
        }
View Full Code Here

                context.getProfiler().message(this, Profiler.START_SEQUENCES,
                "CONTEXT ITEM", contextItem.toSequence());
        }
        if (newDocumentContext)
            context.pushDocumentContext();
        NodeImpl node;
        try {
            MemTreeBuilder builder = context.getDocumentBuilder();
            builder.setReplaceAttributeFlag(true);
            context.proceed(this, builder);
            QName qn = null;
View Full Code Here

TOP

Related Classes of org.exist.memtree.NodeImpl

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.