/*
(non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.BrowseCursor#next()
355877
public JsMessage next() throws SIResourceException
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "next");
      
    AbstractItem msg = null;
  
     if (msgStoreNonLockingCursor != null)
     {
       try
       {
         //Get the next item from the browseCursor and cast it
         //to a SIMPMessage
         msg = msgStoreNonLockingCursor.next();
       }
       catch (MessageStoreException e)
       {
         // MessageStoreException shouldn't occur so FFDC.
         FFDCFilter.processException(
           e,
           "com.ibm.ws.sib.processor.impl.JSBrowseCursor.next",
           "1:106:1.1",
           this);
            
         SibTr.exception(tc, e);
         SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
           new Object[] {
             "com.ibm.ws.sib.processor.impl.JSBrowseCursor",
             "1:113:1.1",
             e });

         if (tc.isEntryEnabled())
           SibTr.exit(tc, "next", e);

         throw new SIResourceException(
           nls.getFormattedMessage(
             "INTERNAL_MESSAGING_ERROR_CWSIP0002",
             new Object[] {
               "com.ibm.ws.sib.processor.impl.JSBrowseCursor",
               "1:124:1.1",
               e },
             null),
           e);
       }

       if (msg != null)
       {
         //Set the redelivered count on the SIBusMessage
         JsMessage jsMsg = ((SIMPMessage) msg).getMessage();
         jsMsg.setRedeliveredCount(msg.guessUnlockCount());
         try
         {
           //Get a safe copy of the message
           jsMsg = jsMsg.getReceived();
         }
         catch (MessageCopyFailedException e)
         {
           // A MessageCopyFailedException is bad, log a FFDC
           FFDCFilter.processException(
             e,
             "com.ibm.ws.sib.processor.impl.JSBrowseCursor.next",
             "1:146:1.1",
             this);
            
           SibTr.exception(tc, e);
           SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
             new Object[] {
               "com.ibm.ws.sib.processor.impl.JSBrowseCursor",
               "1:153:1.1",
               e });

           if (tc.isEntryEnabled())
             SibTr.exit(tc, "next", e);

           throw new SIResourceException(
             nls.getFormattedMessage(
               "INTERNAL_MESSAGING_ERROR_CWSIP0002",
               new Object[] {
                 "com.ibm.ws.sib.processor.impl.JSBrowseCursor",
                 "1:164:1.1",
                 e },
               null),
             e);
         }//end catch
         
         if (tc.isEntryEnabled())
           SibTr.exit(tc, "next", jsMsg);
         //return the copy
         return jsMsg;
         
       }//end if msg!=null
     }//end if msgStoreNonLockingCursor != null
    
   if (tc.isEntryEnabled())
     SibTr.exit(tc, "next", null);
    return null;  
  }
833566
public boolean next() throws IOException {
		boolean hasNext = true;
		try {
			pageId = stream.readInt();
			pageNamespace = stream.readInt();
			pageTitle = stream.readUTFAsArray();
			pageIsRedirect = stream.readBoolean();
		} catch (EOFException e) {
			hasNext = false;
		}
		return hasNext;
	}
543254
public String next() {
        if (entry == null) return null;
        entry = entry.next;
        return entry.element;
    }
895997
public SIBusMessage next()
  throws SISessionUnavailableException, SISessionDroppedException,
         SIResourceException, SIConnectionLostException, 
         SIErrorException
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPIBrowserSession.tc.isEntryEnabled())
      SibTr.entry(CoreSPIBrowserSession.tc, "next", this);

    JsMessage msg = null;
    
    synchronized(this)
    {
      //Check that the session is not closed, if it is throw an exception
      checkNotClosed();
   
      //if the browse cursor is null - it was pub sub - this
      //session will never return any messages
      if (_browseCursor != null)
      {
        try
        {
          //Get the next item from the browseCursor and cast it
          //to a SIMPMessage
          msg = _browseCursor.next();
        }
        catch (SISessionDroppedException e)
        {
          // MessageStoreException shouldn't occur so FFDC.
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.impl.BrowserSessionImpl.next",
            "1:265:1.78.1.7",
            this);

          close();
          
          SibTr.exception(tc, e);
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
            new Object[] {
              "com.ibm.ws.sib.processor.impl.BrowserSessionImpl",
              "1:274:1.78.1.7",
              e });

          if (TraceComponent.isAnyTracingEnabled() && CoreSPIBrowserSession.tc.isEntryEnabled())
            SibTr.exit(CoreSPIBrowserSession.tc, "next", e);
          throw e;
        }
        catch (SIResourceException e)
        {
          // MessageStoreException shouldn't occur so FFDC.
          FFDCFilter.processException(
            e,
            "com.ibm.ws.sib.processor.impl.BrowserSessionImpl.next",
            "1:287:1.78.1.7",
            this);
            
          SibTr.exception(tc, e);
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
            new Object[] {
              "com.ibm.ws.sib.processor.impl.BrowserSessionImpl",
              "1:294:1.78.1.7",
              e });

          if (TraceComponent.isAnyTracingEnabled() && CoreSPIBrowserSession.tc.isEntryEnabled())
            SibTr.exit(CoreSPIBrowserSession.tc, "next", e);
          throw e;
        }
      }//end if
    }//end sync
    
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(CoreSPIBrowserSession.tc, "next", msg);
    return msg;
  }
530179
@Override
    public int next() {
        // if we have cached break positions and we're still in the range
        // covered by them, just move one step forward in the cache
        if (fCachedBreakPositions != null) {
            if (fPositionInCache < fCachedBreakPositions.length - 1) {
                ++fPositionInCache;
                int pos = fCachedBreakPositions[fPositionInCache];
                fText.setIndex(pos);
                return pos;
            }
            else {
                reset();
            }
        }

        int startPos = current();
        fDictionaryCharCount = 0;
        int result = handleNext(fRData.fFTable);
        if (fDictionaryCharCount > 0) {
            result = checkDictionary(startPos, result, false);
        }
        return result;
    }
418496
public Object next()
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, "next");
      
    AOBrowserSession aoBrowserSession;  
    RemoteBrowserReceiver remoteBrowserReceiver;
    if (browserIterator.hasNext())
    {
      aoBrowserSession =  (AOBrowserSession) browserIterator.next();
      
      remoteBrowserReceiver = new RemoteBrowserReceiver(aoBrowserSession);
    }
    else
    {
      remoteBrowserReceiver = null;
    }
    
    if (tc.isEntryEnabled()) 
      SibTr.exit(tc, "next", remoteBrowserReceiver);
    return remoteBrowserReceiver;
  }
333446
public void next() {
		newKeyGroup = false;
		newKVState = false;

		final RocksIteratorWrapper rocksIterator = currentSubIterator.getIterator();
		rocksIterator.next();

		byte[] oldKey = currentSubIterator.getCurrentKey();
		if (rocksIterator.isValid()) {

			currentSubIterator.setCurrentKey(rocksIterator.key());

			if (isDifferentKeyGroup(oldKey, currentSubIterator.getCurrentKey())) {
				heap.offer(currentSubIterator);
				currentSubIterator = heap.remove();
				newKVState = currentSubIterator.getIterator() != rocksIterator;
				detectNewKeyGroup(oldKey);
			}
		} else {
			IOUtils.closeQuietly(rocksIterator);

			if (heap.isEmpty()) {
				currentSubIterator = null;
				valid = false;
			} else {
				currentSubIterator = heap.remove();
				newKVState = true;
				detectNewKeyGroup(oldKey);
			}
		}
	}
1282442
public T next() {
		if(cachedNext == null) {
			throw new NoSuchElementException("call hasNext first!");
		}
		T o = cachedNext;
		cachedNext = null;
		return o;
	}
827197
@Override
    public Sequence<T> next() {
        Sequence<T> sequence = new Sequence<>();
        int[] visitedHops = new int[walkLength];
        Arrays.fill(visitedHops, -1);

        int startPosition = position.getAndIncrement();
        int lastId = -1;
        int startPoint = order[startPosition];
        startPosition = startPoint;
        for (int i = 0; i < walkLength; i++) {

            Vertex<T> vertex = sourceGraph.getVertex(startPosition);

            int currentPosition = startPosition;

            sequence.addElement(vertex.getValue());
            visitedHops[i] = vertex.vertexID();
            int cSpread = 0;

            if (alpha > 0 && lastId != startPoint && lastId != -1 && alpha > rng.nextDouble()) {
                startPosition = startPoint;
                continue;
            }

            switch (walkDirection) {
                case RANDOM:
                case FORWARD_ONLY:
                case FORWARD_UNIQUE:
                case FORWARD_PREFERRED: {

                    // ArrayUtils.removeElements(sourceGraph.getConnectedVertexIndices(order[currentPosition]), visitedHops);
                    int[] connections = ArrayUtils.removeElements(
                                    sourceGraph.getConnectedVertexIndices(vertex.vertexID()), visitedHops);

                    // we get  popularity of each node connected to the current node.
                    PriorityQueue<Node<T>> queue = new PriorityQueue<>(Math.max(10, connections.length), new NodeComparator());

                    int start = 0;
                    int stop = 0;
                    int cnt = 0;
                    if (connections.length > 0) {


                        for (int connected : connections) {
                            Node<T> tNode = new Node<>(connected, sourceGraph.getConnectedVertices(connected).size());
                            queue.add(tNode);
                        }


                        cSpread = spread > connections.length ? connections.length : spread;

                        switch (popularityMode) {
                            case MAXIMUM:
                                start = 0;
                                stop = start + cSpread - 1;
                                break;
                            case MINIMUM:
                                start = connections.length - cSpread;
                                stop = connections.length - 1;
                                break;
                            case AVERAGE:
                                int mid = connections.length / 2;
                                start = mid - (cSpread / 2);
                                stop = mid + (cSpread / 2);
                                break;
                        }

                        // logger.info("Spread: ["+ cSpread+ "], Connections: ["+ connections.length+"], Start: ["+start+"], Stop: ["+stop+"]");
                        cnt = 0;
                        //logger.info("Queue: " + queue);
                        //logger.info("Queue size: " + queue.size());

                        List<Node<T>> list = new ArrayList<>();
                        double[] weights = new double[cSpread];

                        int fcnt = 0;
                        while (!queue.isEmpty()) {
                            Node<T> node = queue.poll();
                            if (cnt >= start && cnt <= stop) {
                                list.add(node);
                                weights[fcnt] = node.getWeight();
                                fcnt++;
                            }
                            connections[cnt] = node.getVertexId();

                            cnt++;
                        }


                        int con = -1;

                        switch (spectrum) {
                            case PLAIN: {
                                con = RandomUtils.nextInt(start, stop + 1);

                                //    logger.info("Picked selection: " + con);

                                Vertex<T> nV = sourceGraph.getVertex(connections[con]);
                                startPosition = nV.vertexID();
                                lastId = vertex.vertexID();
                            }
                                break;
                            case PROPORTIONAL: {
                                double norm[] = MathArrays.normalizeArray(weights, 1);
                                double prob = rng.nextDouble();
                                double floor = 0.0;
                                for (int b = 0; b < weights.length; b++) {
                                    if (prob >= floor && prob < floor + norm[b]) {
                                        startPosition = list.get(b).getVertexId();
                                        lastId = startPosition;
                                        break;
                                    } else {
                                        floor += norm[b];
                                    }
                                }
                            }
                                break;
                        }

                    } else {
                        switch (noEdgeHandling) {
                            case EXCEPTION_ON_DISCONNECTED:
                                throw new NoEdgesException("No more edges at vertex [" + currentPosition + "]");
                            case CUTOFF_ON_DISCONNECTED:
                                i += walkLength;
                                break;
                            case SELF_LOOP_ON_DISCONNECTED:
                                startPosition = currentPosition;
                                break;
                            case RESTART_ON_DISCONNECTED:
                                startPosition = startPoint;
                                break;
                            default:
                                throw new UnsupportedOperationException(
                                                "Unsupported noEdgeHandling: [" + noEdgeHandling + "]");
                        }
                    }
                }
                    break;
                default:
                    throw new UnsupportedOperationException("Unknown WalkDirection: [" + walkDirection + "]");
            }

        }

        return sequence;
    }
143125
public void next() {
        final PlayList pl = getPlaylist();

        final int previousPosition = pl.getCurrentSlide();
        pl.next();
        final int currentPosition = pl.getCurrentSlide();

        playSlide(currentPosition, previousPosition);
    }
640036
public function next()
    {
        $this->offset += $this->length;
        fseek($this->handle, $this->offset);
        $this->index++;
    }
875913
public Object next() {
        try {
            if (!_primed) {
                _primed = _rs.next();
                if (!_primed) {
                    throw new NoSuchElementException();
                }
            }
            // reset upon consumption
            _primed = false;
            return _rowMapper.mapRowToReturnType();
        } catch (SQLException e) {
            // Since Iterator interface is locked, all we can do
            // is put the real exception inside an expected one.
            NoSuchElementException xNoSuch = new NoSuchElementException("ResultSet exception: " + e);
            xNoSuch.initCause(e);
            throw xNoSuch;
        }
    }
978515
@Override
  public void next() {
    if (!hasNext()) {
      throw new IllegalDataException("No more data");
    }
    for (final ITimeSyncedIterator sub : queries.values()) {
      sub.next(timestamp);
    }
    timestamp = nextTimestamp();
  }
625634
public Object next()
  {
    if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "next");
    
    StreamSet sourceStreamSet = (StreamSet)super.next();
    SIMPPtoPOutboundTransmitControllable sourceStreamSetControl = 
      (SIMPPtoPOutboundTransmitControllable)sourceStreamSet.getControlAdapter();
    if(sourceStreamSetControl != null)
    {
      ((SourceStreamSetControl)sourceStreamSetControl).setSourceStreamManager(sourceStreamMgr);
    }
    
    if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "next", sourceStreamSetControl);
    return sourceStreamSetControl;
  }
274306
public Object next()
	{
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "next");
    } 
    
    Object result;
		if (msgIterator.hasNext())
		{
      Long valueStamp = (Long) msgIterator.next();
      
			result = new TransmitMessageRequest(valueStamp.longValue(), aoStream.itemStream, aoStream, messageProcessor, aoh.getDestinationHandler());
		}
		else
		{
			result = null;
		}
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.exit(tc, "next", result);
    } 
    return result;
	}
260505
public boolean next()
    {
        boolean ret = false;
        if (this.iterator == null) {
            this.iterator = this.objects.iterator();
        }
        if (this.iterator.hasNext()) {
            this.current = this.iterator.next();
            ret = true;
        }
        return ret;
    }
32325
@Override
  public Node next() {
    Node cur = next;
    next = next.getNextSibling();
    return cur;
  }