Package org.exist.numbering

Examples of org.exist.numbering.NodeId.compareTo()


            mid = (low + high) / 2;
            id = nodes[mid].getNodeId();
            if (id.isDescendantOrSelfOf(ancestorId)) {
                break; // found a child node, break out.
            }
            cmp = id.compareTo(ancestorId);
            if (cmp > 0) {
                high = mid - 1;
            } else {
                low = mid + 1;
            }
View Full Code Here


                                    if( !nodeId.isChildOf( parent.elem.getNodeId() ) ) {
                                        return( new ErrorReport.ResourceError( ErrorReport.NODE_HIERARCHY, "Node " + nodeId + " is not a child of " + parent.elem.getNodeId() ) );
                                    }

                                    // test sibling relation
                                    if( ( parent.prevSibling != null ) && !( nodeId.isSiblingOf( parent.prevSibling ) && ( nodeId.compareTo( parent.prevSibling ) > 0 ) ) ) {
                                        return( new ErrorReport.ResourceError( ErrorReport.INCORRECT_NODE_ID, "Node " + nodeId + " is not a sibling of " + parent.prevSibling ) );
                                    }
                                    parent.prevSibling = nodeId;
                                }
View Full Code Here

            final NodeId refId = reference.getNodeId();
            for (int i = mid; i >= documentOffsets[docIdx]; i--) {
                final NodeId currentId = nodes[i].getNodeId();
                if (!currentId.isDescendantOf(parentId))
                    {break;}
                if (currentId.getTreeLevel() == refId.getTreeLevel() && currentId.compareTo(refId) < 0) {
                    if (Expression.IGNORE_CONTEXT != contextId) {
                        if (Expression.NO_CONTEXT_ID == contextId) {
                            nodes[i].copyContext(reference);
                        } else {
                            nodes[i].addContextNode(contextId, reference);
View Full Code Here

            final NodeId refId = reference.getNodeId();
            for (int i = mid; i < end; i++) {
                final NodeId currentId = nodes[i].getNodeId();
                if (!currentId.isDescendantOf(parentId))
                    {break;}
                if (currentId.getTreeLevel() == refId.getTreeLevel() && currentId.compareTo(refId) > 0) {
                    if (Expression.IGNORE_CONTEXT != contextId) {
                        if (Expression.NO_CONTEXT_ID == contextId) {
                            nodes[i].copyContext(reference);
                        } else {
                            nodes[i].addContextNode(contextId, reference);
View Full Code Here

                mid = (low + high) / 2;
                id = array[mid].getNodeId();
                if (id.isDescendantOrSelfOf(ancestorId)) {
                    break; // found a child node, break out.
                }
                cmp = id.compareTo(ancestorId);
                if (cmp > 0) {
                    high = mid - 1;
                } else {
                    low = mid + 1;
                }
View Full Code Here

                final int level = nodeId.getTreeLevel();
                while (reader.hasNext()) {
                    final int status = reader.next();
                    final NodeId currentId = (NodeId) reader.getProperty(ExtendedXMLStreamReader.PROPERTY_NODE_ID);
                    if (status != XMLStreamConstants.END_ELEMENT && currentId.getTreeLevel() == level) {
                        if (currentId.compareTo(nodeId) > 0)
                            {return reader.getNode();}
                    }
                }
            } catch (final IOException e) {
                LOG.error("Internal error while reading child nodes: " + e.getMessage(), e);
View Full Code Here

        {return true;}
      final NodeId refId = referenceNode.getNodeId();
      final NodeId currentId = (NodeId) reader
          .getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
      if (!isAfter)
        {isAfter = currentId.compareTo(refId) > 0
            && !currentId.isDescendantOf(refId);}
      if (isAfter && !refId.isDescendantOf(currentId)
          && test.matches(reader)) {
        final NodeProxy proxy = new NodeProxy(referenceNode.getDocument(),
            currentId, StaXUtil.streamType2DOM(reader
View Full Code Here

      if (reader.getEventType() == XMLStreamReader.END_ELEMENT)
        {return true;}
      final NodeId refId = referenceNode.getNodeId();
      final NodeId currentId = (NodeId) reader
          .getProperty(EmbeddedXMLStreamReader.PROPERTY_NODE_ID);
      if (currentId.compareTo(refId) >= 0)
        {return false;}
      if (!refId.isDescendantOf(currentId) && test.matches(reader)) {
        final NodeProxy proxy = new NodeProxy(referenceNode.getDocument(),
            currentId, StaXUtil.streamType2DOM(reader
                .getEventType()),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.