Gets the iterator.

@return the iterator
175855
private Iterator<String> getIterator() {
		final Set<String> copy = getPrefixes();
		final Iterator<String> copyIt = copy.iterator();
		return new Iterator<String>() {
			private String lastOne = null;

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

			@Override
			public String next() {
				if (copyIt.hasNext()) {
					lastOne = copyIt.next();
				} else {
					throw new NoSuchElementException();
				}
				return lastOne;
			}

			@Override
			public void remove() {
				try {
					lock.writeLock().lock();
					prefixes.remove(lastOne);
				} finally {
					lock.writeLock().unlock();
				}
			}

		};
	}
1158326
public Iterator<K> keys()
  {
    KeyIterator<K,V> iter = new KeyIterator<K,V>(this);

    iter.init(this);

    return iter;
  }
486782
@Override
    public Iterator<String> iterator() {
        this.reset();
        Iterator<String> ret = new Iterator<String>() {
            @Override
            public boolean hasNext() {
                return BasicLineIterator.this.hasNext();
            }

            @Override
            public String next() {
                return BasicLineIterator.this.nextSentence();
            }

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

        return ret;
    }
641353
public function getIterator()
    {
        if ($this->iteratorCreator) {
            return call_user_func($this->iteratorCreator, $this, $this->filesystem);
        }

        return $this->createIterator();
    }
797744
public IntSet.IntIterator iterator()
  {
    if (isEmpty()) {
      return new IntSet.IntIterator()
      {
        @Override
        public void skipAllBefore(int element) {/*empty*/}

        @Override
        public boolean hasNext() {return false;}

        @Override
        public int next() {throw new NoSuchElementException();}

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

        @Override
        public IntSet.IntIterator clone() {throw new UnsupportedOperationException();}
      };
    }
    return new BitIterator();
  }
1080323
public Iterator<E> iterator ()
    {
        // the crazy sanity checks
        if (_size < 0 || _size > _entries.length || (_size > 0 && _entries[_size-1] == null)) {
            log.warning("DSet in a bad way", "size", _size, "entries", _entries, new Exception());
        }

        return new Iterator<E>() {
            public boolean hasNext () {
                checkComodification();
                return (_index < _size);
            }
            public E next () {
                checkComodification();
                return _entries[_index++];
            }
            public void remove () {
                throw new UnsupportedOperationException();
            }
            protected void checkComodification () {
                if (_modCount != _expectedModCount) {
                    throw new ConcurrentModificationException();
                }
                if (_ssize != _size) {
                    log.warning("Size changed during iteration", "ssize", _ssize, "nsize", _size,
                                "entries", _entries, new Exception());
                }
            }
            protected int _index = 0;
            protected int _ssize = _size;
            protected int _expectedModCount = _modCount;
        };
    }
1113335
public function getIterator() {
        $iterator = new AppendIterator;

        if($this->wrapped_object instanceof IteratorAggregate) {
            $iterator->append($element->getIterator());
        }
        else {
            $iterator->append(new ArrayIterator($this->wrapped_object));
        }
        $iterator->append(parent::getIterator());
        return $iterator;
    }
821634
@Override
    public Iterator<T> iterator() {
        if (m_items == null) {
            m_items = new TreeMap<String, T>();
        }
        return m_items.values().iterator();
    }
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();
            }
        };
    }
492374
@SuppressWarnings("NullableProblems")
  @Override
  public Iterator<T> iterator() {
    return new Iterator<T>() {
      private int index = 0;

      @Override
      public boolean hasNext() {
        return this.index < size();
      }

      @Override
      public T next() {
        if (this.index >= size()) {
          throw new NoSuchElementException(this.index + ">=" + size());
        }
        return getElementAt(this.index++);
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("Removing is unsupported here");
      }

    };
  }
185729
public function getIterator()
    {
        $iterator   = parent::getIterator();
        $content    = $this->getDependentContent();

        if ( $content )
        {
            $iterator->append( new ArrayIterator( array(
                'rootCreated'   => $content->created,
                'rootUserId'    => $content->userId,
            ) ) );
        }

        return $iterator;
    }
1332830
@Override
    public Iterator<Object> iterator() {
        return new Iterator<Object>() {
            Iterator<Object> iter = list.listIterator();

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

            @Override
            public Object next() {
                return iter.next();
            }

            @Override
            public void remove() {
                iter.remove();
            }
        };
    }
388729
private function getIterator() {
		if ($this->iterator === null) {
			$this->iterator = new DirectoryIterator($this->pathname);
		}
		return $this->iterator;
	}
191248
public function getIterator()
    {
        $files = array();
        $iterator = $this->getFlyIterator(Directory::ITERATOR_FILE | Directory::ITERATOR_RECURSIVE);
        foreach ($iterator as $file) {
            $files[] = $this->getRelPath($file);
        }
        return new ArrayIterator($files);
    }
1148246
public <T> CursorIterator<T> asIterator() {
		CursorIterable<T> iterable = asIterable();
		return iterable.iterator();
	}
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()." );
                }
            }
        };
    }
411376
@Nonnull
    public Iterator<S> bfsIterator() {
        Set<S> visited = new HashSet<>();
        final Deque<S> bfsQueue = new ArrayDeque<>();
        bfsQueue.add(root);
        visited.add(root);

        return new AbstractIterator<S>() {

            @Override
            protected S computeNext() {
                S next = bfsQueue.poll();
                if (next == null) {
                    return endOfData();
                }
                for (int i = 0; i < alphabetSize; i++) {
                    S child = next.getSuccessor(i);
                    if (child != null && visited.add(child)) {
                        bfsQueue.offer(child);
                    }
                }
                return next;
            }
        };
    }