Returns the next element in the iteration.

@return the {@link HistogramIterationValue} associated with the next element in the iteration.
435242
@Override
    public HistogramIterationValue next() {
        // Move through the sub buckets and buckets until we hit the next reporting level:
        while (!exhaustedSubBuckets()) {
            countAtThisValue = histogram.getCountAtIndex(currentIndex);
            if (freshSubBucket) { // Don't add unless we've incremented since last bucket...
                totalCountToCurrentIndex += countAtThisValue;
                totalValueToCurrentIndex += countAtThisValue * histogram.highestEquivalentValue(currentValueAtIndex);
                freshSubBucket = false;
            }
            if (reachedIterationLevel()) {
                long valueIteratedTo = getValueIteratedTo();
                currentIterationValue.set(valueIteratedTo, prevValueIteratedTo, countAtThisValue,
                        (totalCountToCurrentIndex - totalCountToPrevIndex), totalCountToCurrentIndex,
                        totalValueToCurrentIndex, ((100.0 * totalCountToCurrentIndex) / arrayTotalCount),
                        getPercentileIteratedTo(), integerToDoubleValueConversionRatio);
                prevValueIteratedTo = valueIteratedTo;
                totalCountToPrevIndex = totalCountToCurrentIndex;
                // move the next iteration level forward:
                incrementIterationLevel();
                if (histogram.getTotalCount() != savedHistogramTotalRawCount) {
                    throw new ConcurrentModificationException();
                }
                return currentIterationValue;
            }
            incrementSubBucket();
        }
        // Should not reach here. But possible for overflowed histograms under certain conditions
        throw new ArrayIndexOutOfBoundsException();
    }
845438
private void nextValue() {
		while (iterator.hasNext()) {
			nextValue = iterator.next();
			if (nextValue.isExpired() == false) {
				return;
			}
		}
		nextValue = null;
	}
892983
public Iterator iterator() {
        // remove garbage collected elements
        processQueue();

        // get an iterator of the superclass WeakHashSet
        final Iterator i = super.iterator();

        return new Iterator() {
            public boolean hasNext() {
                return i.hasNext();
            }

            public Object next() {
                // unwrap the element
                return getReferenceObject((WeakReference) i.next());
            }

            public void remove() {
                // remove the element from the HashSet
                i.remove();
            }
        };
    }
312629
public Iterator<Long> iterator() {
    final LongIterator it = getLongIterator();

    return new Iterator<Long>() {

      @Override
      public boolean hasNext() {
        return it.hasNext();
      }

      @Override
      public Long next() {
        return it.next();
      }

      @Override
      public void remove() {
        // TODO?
        throw new UnsupportedOperationException();
      }
    };
  }
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;
	}
1111844
protected int getNextNode()
  {
    m_lastFetched = (DTM.NULL == m_lastFetched)
                     ? m_traverser.first(m_context)
                     : m_traverser.next(m_context, m_lastFetched);
    return m_lastFetched;
  }
240118
public Iterator<Symbol> iterator() {
        return scope.getSymbols(t -> !unwanted(t), NON_RECURSIVE).iterator();
    }
50350
public Object nextElement() 
    {
        if (_array == null)
        {
            return null;
        }
        else
        {
            synchronized(this){
                if (_index < _array.length)
                {
                    Object obj = _array[_index];
                    _index++;
                    return obj;
                }
                else
                {
                    return null;
                }
            }
        }
    }
900998
public Iterator<V> values()
  {
    ValueIterator<K,V> iter = new ValueIterator<K,V>(this);
    iter.init(this);
    return iter;
  }
39253
public T first() {
        Iterator<T> iterator = iterator();
        return (iterator.hasNext() ? iterator.next() : null);
    }
900173
public T next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        // 'next' is guaranteed non-null by a hasNext() which returned true
        T returnObj = this.next;
        this.next = null;
        return returnObj;
    }
55902
protected int getNextNode()
  {
    if (null != m_exprObj)
    {
      m_lastFetched = m_exprObj.nextNode();
    }
    else
      m_lastFetched = DTM.NULL;

    return m_lastFetched;
  }
63416
public Iterator<DataPoint> getDataPointIterator()
    {
        Iterator<DataPoint> iteData = new Iterator<DataPoint>() 
        {
            int cur = 0;
            int to = size();

            @Override
            public boolean hasNext()
            {
                return cur < to;
            }

            @Override
            public DataPoint next()
            {
                return getDataPoint(cur++);
            }

            @Override
            public void remove()
            {
                throw new UnsupportedOperationException("This operation is not supported for DataSet");
            }
        };
        
        return iteData;
    }
224435
public Iterator iterator() {
        return new Iterator() {
            private LeftTupleSinkNode currentNode = null;
            private LeftTupleSinkNode nextNode    = getFirst();

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

            public Object next() {
                this.currentNode = this.nextNode;
                if ( this.currentNode != null ) {
                    this.nextNode = this.currentNode.getNextLeftTupleSinkNode();
                } else {
                    throw new NoSuchElementException( "No more elements to return" );
                }
                return this.currentNode;
            }

            public void remove() {
                if ( this.currentNode != null ) {
                    LeftTupleSinkNodeList.this.remove( this.currentNode );
                    this.currentNode = null;
                } else {
                    throw new IllegalStateException( "No item to remove. Call next() before calling remove()." );
                }
            }
        };
    }
1293855
public final GraphIterationElement<ST, PT> nextElement() {
		if (!this.courseModel.isEmpty()) {
			final GraphIterationElement<ST, PT> theElement = this.courseModel.removeNextIterationElement();
			if (theElement != null) {
				final List<GraphIterationElement<ST, PT>> list = getNextSegments(true, theElement);
				final Iterator<GraphIterationElement<ST, PT>> iterator;
				boolean hasFollowingSegments = false;
				GraphIterationElement<ST, PT> elt;

				if (this.courseModel.isReversedRestitution()) {
					iterator = new ReverseIterator<>(list);
				} else {
					iterator = list.iterator();
				}

				while (iterator.hasNext()) {
					elt = iterator.next();
					if (canGotoIntoElement(elt)) {
						hasFollowingSegments = true;
						this.courseModel.addIterationElement(elt);
						if (!this.allowManyReplies) {
							this.visited.add(elt);
						}
					}
				}

				theElement.setTerminalSegment(!hasFollowingSegments);
				theElement.replied = true;
				this.current = theElement;
				return this.current;
			}
		}
		clear();
		throw new NoSuchElementException();
	}
698739
@Override
    public Iterator<int[]> iterator() {
        final DfState lstate = new DfState(this);
        return new Iterator<int[]>() {
            boolean hasNext;

            @Override
            public boolean hasNext() {
                return hasNext || (hasNext = lstate.matchNext());
            }

            @Override
            public int[] next() {
                if (!hasNext())
                    return new int[0];
                hasNext = false;
                return lstate.amap;
            }

            @Override
            public void remove() {
                throw new IllegalArgumentException();
            }
        };
    }
87430
@Override
    public DataSet next() {
        DataSet next = iter.next();
        next.setLabels(next.getFeatures());
        return next;
    }