Get the next random unvisited position.

@return The next unvisited position.
772202
public int getNextRandomUnvisitedPosition() {

    // if all are visited, return -1
    //
    if (0 == this.unvisitedCount) {
      return -1;
    }

    // if there is space continue with random sampling
    //
    int i = this.randomizer.nextInt(this.registry.length);
    while (ONE == registry[i]) {
      i = this.randomizer.nextInt(this.registry.length);
    }
    return i;
  }
834048
public long findPosition(long nOccurrence) {
		updateCount();
		if (nOccurrence <= 0) {
			return RankedBitVector.NOT_FOUND;
		}
		int findPos = (int) (nOccurrence / this.blockSize);
		if (findPos < this.positionArray.length) {
			long pos0 = this.positionArray[findPos];
			long leftOccurrences = nOccurrence - (findPos * this.blockSize);
			if (leftOccurrences == 0) {
				return pos0;
			}
			for (long index = pos0 + 1; index < this.bitVector.size(); index++) {
				if (this.bitVector.getBit(index) == this.bit) {
					leftOccurrences--;
				}
				if (leftOccurrences == 0) {
					return index;
				}
			}
		}
		return RankedBitVector.NOT_FOUND;
	}
261082
public long getPosition()
   {
      initialize();
      long position = scoreNodes.getPosition() - invalid;
      // scoreNode.getPosition() is one ahead
      // if there is a prefetched node
      if (next != null)
      {
         position--;
      }
      return position;
   }
928458
public long nextBackOffMillis() throws IOException {
    // Make sure we have not gone over the maximum elapsed time.
    if (getElapsedTimeMillis() > maxElapsedTimeMillis) {
      return STOP;
    }
    int randomizedInterval =
        getRandomValueFromInterval(randomizationFactor, Math.random(), currentIntervalMillis);
    incrementCurrentInterval();
    return randomizedInterval;
  }
862781
public Object next()
  {
    if (tc.isEntryEnabled())
    {
      SibTr.entry(tc, "next");
    } 
    
    Object result;
    if (hasNext())
    {
      AnycastInputHandler aih = (AnycastInputHandler) anycastIHIterator.next();
      
      result = aih.getControlAdapter();
    }
    else
    {
      result = null;
    }
    
    if (tc.isEntryEnabled())
    {
      SibTr.exit(tc, "next", result);
    } 
    return result;
  }
956991
private int next() throws IOException, UnterminatedCommentException {
		int c = get();
		if (c == '/') {
			switch (peek()) {
			case '/':
				for (;;) {
					c = get();
					if (c <= '\n') {
						break;
					}
				}
				break;
			case '*':
				get();
				while (c != ' ') {
					switch (get()) {
					case '*':
						if (peek() == '/') {
							get();
							c = ' ';
						}
						break;
					case EOF:
						throw new UnterminatedCommentException(currentByteIndex, line, column);
					}
				}
				break;
			}
		}
		theY = theX;
		theX = c;
		return c;
	}
561136
public ScreenLocation getNextLocation(short position, short setNewAnchor)
    {
        if (position == ScreenConstants.FIRST_LOCATION)
            position = ScreenConstants.FIRST_INPUT_LOCATION;
        if (position == ScreenConstants.NEXT_LOGICAL)
            position = ScreenConstants.BELOW_LAST_ANCHOR;
        return super.getNextLocation(position, setNewAnchor);
    }
1271491
public Object next()
    {
        _current1.reset();
        if (_last1.key() == null)
            findFirst(_dstack);
        else
        {
            findNext(_dstack);
            if (_current1.key() == null)
                _eof = true;
        }

        if (_current1.key() != null)
            _last1.setLocation(_current1);

        return _current1.key();
    }
809810
public String next() {
        if (next == null)
            throw new NoSuchElementException();
        String replacement = replacementMap.get(next);
        replacement = (replacement == null) ? next : replacement;
        advance();
        return replacement;
    }
1065478
@Override
    public Sequence<T> next() {
        int[] visitedHops = new int[walkLength];
        Arrays.fill(visitedHops, -1);

        Sequence<T> sequence = new Sequence<>();

        int startPosition = position.getAndIncrement();
        int lastId = -1;
        int startPoint = order[startPosition];
        //System.out.println("");


        startPosition = startPoint;

        //if (startPosition == 0 || startPoint % 1000 == 0)
        //   System.out.println("ATZ Walk: ");

        for (int i = 0; i < walkLength; i++) {
            Vertex<T> vertex = sourceGraph.getVertex(startPosition);

            int currentPosition = startPosition;

            sequence.addElement(vertex.getValue());
            visitedHops[i] = vertex.vertexID();
            //if (startPoint == 0 || startPoint % 1000 == 0)
            // System.out.print("" + vertex.vertexID() + " -> ");


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


            // get next vertex
            switch (walkDirection) {
                case RANDOM: {
                    int[] nextHops = sourceGraph.getConnectedVertexIndices(currentPosition);
                    startPosition = nextHops[rng.nextInt(nextHops.length)];
                }
                    break;
                case FORWARD_ONLY: {
                    // here we remove only last hop
                    int[] nextHops = ArrayUtils.removeElements(sourceGraph.getConnectedVertexIndices(currentPosition),
                                    lastId);
                    if (nextHops.length > 0) {
                        startPosition = nextHops[rng.nextInt(nextHops.length)];
                    } else {
                        switch (noEdgeHandling) {
                            case CUTOFF_ON_DISCONNECTED: {
                                i += walkLength;
                            }
                                break;
                            case EXCEPTION_ON_DISCONNECTED: {
                                throw new NoEdgesException("No more edges at vertex [" + currentPosition + "]");
                            }
                            case SELF_LOOP_ON_DISCONNECTED: {
                                startPosition = currentPosition;
                            }
                                break;
                            case PADDING_ON_DISCONNECTED: {
                                throw new UnsupportedOperationException("PADDING not implemented yet");
                            }
                            case RESTART_ON_DISCONNECTED: {
                                startPosition = startPoint;
                            }
                                break;
                            default:
                                throw new UnsupportedOperationException(
                                                "NoEdgeHandling mode [" + noEdgeHandling + "] not implemented yet.");
                        }
                    }
                }
                    break;
                case FORWARD_UNIQUE: {
                    // here we remove all previously visited hops, and we don't get  back to them ever
                    int[] nextHops = ArrayUtils.removeElements(sourceGraph.getConnectedVertexIndices(currentPosition),
                                    visitedHops);
                    if (nextHops.length > 0) {
                        startPosition = nextHops[rng.nextInt(nextHops.length)];
                    } else {
                        // if we don't have any more unique hops within this path - break out.
                        switch (noEdgeHandling) {
                            case CUTOFF_ON_DISCONNECTED: {
                                i += walkLength;
                            }
                                break;
                            case EXCEPTION_ON_DISCONNECTED: {
                                throw new NoEdgesException("No more edges at vertex [" + currentPosition + "]");
                            }
                            case SELF_LOOP_ON_DISCONNECTED: {
                                startPosition = currentPosition;
                            }
                                break;
                            case PADDING_ON_DISCONNECTED: {
                                throw new UnsupportedOperationException("PADDING not implemented yet");
                            }
                            case RESTART_ON_DISCONNECTED: {
                                startPosition = startPoint;
                            }
                                break;
                            default:
                                throw new UnsupportedOperationException(
                                                "NoEdgeHandling mode [" + noEdgeHandling + "] not implemented yet.");
                        }
                    }
                }
                    break;
                case FORWARD_PREFERRED: {
                    // here we remove all previously visited hops, and if there's no next unique hop available - we fallback to anything, but the last one
                    int[] nextHops = ArrayUtils.removeElements(sourceGraph.getConnectedVertexIndices(currentPosition),
                                    visitedHops);
                    if (nextHops.length == 0) {
                        nextHops = ArrayUtils.removeElements(sourceGraph.getConnectedVertexIndices(currentPosition),
                                        lastId);
                        if (nextHops.length == 0) {
                            switch (noEdgeHandling) {
                                case CUTOFF_ON_DISCONNECTED: {
                                    i += walkLength;
                                }
                                    break;
                                case EXCEPTION_ON_DISCONNECTED: {
                                    throw new NoEdgesException("No more edges at vertex [" + currentPosition + "]");
                                }
                                case SELF_LOOP_ON_DISCONNECTED: {
                                    startPosition = currentPosition;
                                }
                                    break;
                                case PADDING_ON_DISCONNECTED: {
                                    throw new UnsupportedOperationException("PADDING not implemented yet");
                                }
                                case RESTART_ON_DISCONNECTED: {
                                    startPosition = startPoint;
                                }
                                    break;
                                default:
                                    throw new UnsupportedOperationException("NoEdgeHandling mode [" + noEdgeHandling
                                                    + "] not implemented yet.");
                            }
                        } else
                            startPosition = nextHops[rng.nextInt(nextHops.length)];
                    }
                }
                    break;
                default:
                    throw new UnsupportedOperationException("Unknown WalkDirection [" + walkDirection + "]");
            }

            lastId = vertex.vertexID();
        }

        //if (startPoint == 0 || startPoint % 1000 == 0)
        //System.out.println("");
        return sequence;
    }
1164156
public T next() {
        if (entry == null) return null;
        entry = entry.next;
        return entry.element;
    }
16280
public Entry getNext()
  {
    checkEntryParent();
    
    Entry entry = null;
    
    if(!isLast())
    {
      entry = next;
    }

    return entry;
  }
914703
public int getCurrentPosition() {
        int curPosition = -1;
        if (getLayoutManager().canScrollHorizontally()) {
            curPosition = ViewUtils.getCenterXChildPosition(this);
        } else {
            curPosition = ViewUtils.getCenterYChildPosition(this);
        }
        if (curPosition < 0) {
            curPosition = mSmoothScrollTargetPosition;
        }
        return curPosition;
    }
897342
public int[] next()
    {
        boolean hasNewPerm = false;

        escape:while( level >= 0) {
//            boolean foundZero = false;
            for( int i = iter[level]; i < data.length; i = iter[level] ) {
                iter[level]++;

                if( data[i] == -1 ) {
                    level++;
                    data[i] = level-1;

                    if( level >= data.length ) {
                        // a new permutation has been created return the results.
                        hasNewPerm = true;
                        System.arraycopy(data,0,ret,0,ret.length);
                        level = level-1;
                        data[i] = -1;
                        break escape;
                    } else {
                        valk[level] = i;
                    }
                }
            }

            data[valk[level]] = -1;
            iter[level] = 0;
            level = level-1;

        }

        if( hasNewPerm )
            return ret;
        return null;
    }
1050892
public E getNextValue() throws ValueGenerationException{
		if(!isValid())
			throw new ValueGenerationException("Cannot provide elements in invalid state.");
		Double random = rand.nextDouble();
		for(int i=0; i<limits.size(); i++)
			if(random <= limits.get(i)){
				return keys.get(i);
			}
		return null;
	}
543254
public String next() {
        if (entry == null) return null;
        entry = entry.next;
        return entry.element;
    }
1297610
public A next() {
        A x = elems.head;
        if (!elems.isEmpty()) {
            elems = elems.tail;
            if (elems.isEmpty()) last = null;
            count--;
        }
        return x;
    }