Get next sibling
@return NodeAbstraction
@nestedSetMethod
7932
public function getNextSibling()
	{
		$left = $this->getRightValue() + 1;
		$searchCondition = $this->repository->createSearchCondition()
				->leftEqualsTo($left);

		$nextSibling = $this->repository->search($searchCondition);
		if ( ! isset($nextSibling[0])) {
			return null;
		}
		$nextSibling = $nextSibling[0];
		
		return $nextSibling;
	}
978598
public int getCurrentNode()
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        "This NodeSetDTM can not do indexing or counting functions!");

    int saved = m_next;
    // because nextNode always increments
    // But watch out for copy29, where the root iterator didn't
    // have nextNode called on it.
    int current = (m_next > 0) ? m_next-1 : m_next; 
    int n = (current < m_firstFree) ? elementAt(current) : DTM.NULL;
    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
    return n;
  }
667534
protected int getNextNode()
  {
    if (m_foundLast)
      return DTM.NULL;

    int next = m_iterator.next();
    
    if (m_isFresh)
      m_isFresh = false;

    if (DTM.NULL == next)
      this.m_foundLast = true;

    return next;
  }
799866
private function getSibling($offset)
    {
        $siblingsAndSelf = $this->parent->getChildren();
        $pos             = array_search($this, $siblingsAndSelf);
        if (isset($siblingsAndSelf[$pos + $offset])) {
            return $siblingsAndSelf[$pos + $offset]; // Next / prev. node
        }
        return null;
    }
508155
protected function NextItem()
	{
		while (true)
		{
			if ( ! is_null( $this->childIter ) )
			{
				if ( $this->childIter instanceof ExprIterator )
				{
					$result = $this->childIter;
					$this->childIter = null;
					return $result;
				}
				else
				{
					if ( $this->childIter->MoveNext() )
						return $this->childIter->getCurrent();
					else
						$this->childIter = null;
				}
			}
			if ( ! $this->iter->MoveNext() )
				return null;

			if ( $this->owner->MoveNext( $this->provider, $this->dataPool, $this->iter->getCurrent(), $res ) )
			{
				if ( $res instanceof XPath2NodeIterator )
				{
					$this->childIter = $res;
				}
				else
				{
					$this->childIter = null;
					return $res instanceof XPathItem
						? $res
						: XPath2Item::fromValue( $res );
				}
			}
		}
	}
860430
public Node nextSibling() {
        if (parentNode == null)
            return null; // root

        final List<Node> siblings = parentNode.ensureChildNodes();
        final int index = siblingIndex+1;
        if (siblings.size() > index)
            return siblings.get(index);
        else
            return null;
    }
896977
protected function NextItem()
	{
		while (true)
		{
			if ( ! is_null( $this->childIter ) )
			{
				if ( $this->childIter->MoveNext() )
					return $this->childIter->getCurrent();
				else
					$this->childIter = null;
			}

			if ( $this->iter->MoveNext() )
			{
				$res = $this->iter->current();

				if ( $res instanceof XPath2NodeIterator )
				{
					$this->childIter = $res;
				}
				else
				{
					$this->childIter = null;
					return $res instanceof XPathItem
						? $res
						: XPath2Item::fromValue( $res );
				}
			}
			else
			{
				return null;
			}
		}
	}
1166294
public function next() {
		$next = $this->domnode;
		if(!$next)
			return new Node(null);
		while(true) {
			$next = $next->nextSibling;
			if(!$next)
				return new Node(null);
			if($next->nodeType == XML_ELEMENT_NODE)
				return new Node($next);
		}
	}
166878
private int getNextChildIndex(InternalQName nameToAdd, InternalQName primaryTypeName, NodeData parentNode,
      NodeDefinitionData def) throws RepositoryException, ItemExistsException
   {
      boolean allowSns = def.isAllowsSameNameSiblings();

      int ind = 1;

      boolean hasSibling = dataManager.hasItemData(parentNode, new QPathEntry(nameToAdd, ind), ItemType.NODE);
      while (hasSibling)
      {
         if (allowSns)
         {
            ind++;
            hasSibling = dataManager.hasItemData(parentNode, new QPathEntry(nameToAdd, ind), ItemType.NODE);
         }
         else
         {
            throw new ItemExistsException("The node " + nameToAdd + " already exists in " + getPath()
               + " and same name sibling is not allowed ");
         }
      };

      return ind;
   }
504497
public LeafNode<K, V> nextNode() {
		if (rightid == NULL_ID) {
			return null;
		}
		return (LeafNode<K, V>) tree.getNode(rightid);
	}
260968
public function siblings()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        return $this->createSubCrawler($this->sibling($this->getNode(0)->parentNode->firstChild));
    }
84499
public Iterator childNodes() {
        return new Iterator() {
            private final Iterator iter = Node.this.children.iterator();
            private Object nextElementNodes = getNextElementNodes();

            public boolean hasNext() {
                return this.nextElementNodes != null;
            }

            public Object next() {
                try {
                    return this.nextElementNodes;
                } finally {
                    this.nextElementNodes = getNextElementNodes();
                }
            }

            public void remove() {
                throw new UnsupportedOperationException();
            }

            private Object getNextElementNodes() {
                while (iter.hasNext()) {
                    final Object node = iter.next();
                    if (node instanceof Node) {
                        return node;
                    }
                }
                return null;
            }
        };
    }
114743
public List<Node> siblingNodes() {
        if (parentNode == null)
            return Collections.emptyList();

        List<Node> nodes = parentNode.ensureChildNodes();
        List<Node> siblings = new ArrayList<>(nodes.size() - 1);
        for (Node node: nodes)
            if (node != this)
                siblings.add(node);
        return siblings;
    }
353132
public HelpTopicNode getNextSibling() {
        int i = getIndex() + 1;
        return i == 0 || i == parent.children.size() ? null : parent.children.get(i);
    }
1247365
public final Link getNextLink() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(this, tc, "getNextLink", _positionString());
        }
        Link nextLink = null;
        LinkedList parent = _parent;
        if (null != parent) {
            nextLink = _parent.getNextLink(this);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(this, tc, "getNextLink", nextLink);
        }
        return nextLink;
    }
1162459
public function getBranchAsTree()
    {
        $lastParents = array();
        
        foreach ($this->getBranch() as $page)
        {
            if (!$page->isRoot())
            {
                $lastParents[$page->getLevel() - 1]->addNestedSetChild($page);
            }
            
            $lastParents[$page->getLevel()] = $page;
        }
        
        return $this;
    }
1071029
public Node previousSibling() {
        if (parentNode == null)
            return null; // root

        if (siblingIndex > 0)
            return parentNode.ensureChildNodes().get(siblingIndex-1);
        else
            return null;
    }