/*
(non-Javadoc)

@see edu.umd.cs.findbugs.classfile.IScannableCodeBase#iterator()
433206
@Override
    public ICodeBaseIterator iterator() throws InterruptedException {
        return new ICodeBaseIterator() {
            boolean done = false;

            /*
             * (non-Javadoc)
             *
             * @see edu.umd.cs.findbugs.classfile.ICodeBaseIterator#hasNext()
             */
            @Override
            public boolean hasNext() throws InterruptedException {
                return !done;
            }

            /*
             * (non-Javadoc)
             *
             * @see edu.umd.cs.findbugs.classfile.ICodeBaseIterator#next()
             */
            @Override
            public ICodeBaseEntry next() throws InterruptedException {
                if (done) {
                    throw new NoSuchElementException();
                }
                done = true;
                return new SingleFileCodeBaseEntry(SingleFileCodeBase.this);
            }
        };
    }
1218033
@Override
    protected Iterator<?> getJavaIterator(Context cx, Scriptable scope, Object obj) {
        if (obj instanceof Wrapper) {
            Object unwrapped = ((Wrapper) obj).unwrap();
            Iterator<?> iterator = null;
            if (unwrapped instanceof Iterator)
                iterator = (Iterator<?>) unwrapped;
            if (unwrapped instanceof Iterable)
                iterator = ((Iterable<?>)unwrapped).iterator();
            return iterator;
        }
        return null;
    }
823134
public Iterator<Member> iterator() {
    final Iterator<String> namesIterator = names.iterator();
    final Iterator<JsonValue> valuesIterator = values.iterator();
    return new Iterator<JsonObject.Member>() {

      public boolean hasNext() {
        return namesIterator.hasNext();
      }

      public Member next() {
        String name = namesIterator.next();
        JsonValue value = valuesIterator.next();
        return new Member(name, value);
      }

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

    };
  }
178237
public Iterator entryIterator()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass,
                        "entryIterator");

        Iterator entryIterator = subList(null, null).entryIterator();

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass,
                       "entryIterator",
                       new Object[] { entryIterator });
        return entryIterator;
    }
577346
@Nonnull
    public Iterator<Long> iterator() {
        return new Iterator<Long>() {
            private long base2 = base;
            private int remaining = batchSize;

            @Override
            public boolean hasNext() {
                return remaining > 0;
            }

            @Override
            public Long next() {
                if (remaining == 0) {
                    throw new NoSuchElementException();
                }
                remaining--;
                try {
                    return base2;
                } finally {
                    base2 += increment;
                }
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }
328253
public Iterator<Throwable> iterator() {

       return new Iterator<Throwable>() {

           SQLException firstException = SQLException.this;
           SQLException nextException = firstException.getNextException();
           Throwable cause = firstException.getCause();

           public boolean hasNext() {
               if(firstException != null || nextException != null || cause != null)
                   return true;
               return false;
           }

           public Throwable next() {
               Throwable throwable = null;
               if(firstException != null){
                   throwable = firstException;
                   firstException = null;
               }
               else if(cause != null){
                   throwable = cause;
                   cause = cause.getCause();
               }
               else if(nextException != null){
                   throwable = nextException;
                   cause = nextException.getCause();
                   nextException = nextException.getNextException();
               }
               else
                   throw new NoSuchElementException();
               return throwable;
           }

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

       };

    }
154464
@Override
    public IntIterator iterator() {

        return new IntIterator() {

            private final org.roaringbitmap.IntIterator iterator = bitmap.getIntIterator();

            @Override
            public int nextInt() {
                return iterator.next();
            }

            @Override
            public int skip(int k) {
                throw new UnsupportedOperationException("Views do not support skipping in the iterator");
            }

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }
        };
    }
190403
@Override
    public Iterator<ENTITY> iterator() {

        StatementWrapper statementWrapper = new BoundStatementWrapper(getOperationType(boundStatement), meta,
                boundStatement, encodedBoundValues);

        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace(String.format("Generate iterator for typed query : %s",
                    statementWrapper.getBoundStatement().preparedStatement().getQueryString()));
        }

        CompletableFuture<ResultSet> futureRS = rte.execute(statementWrapper);
        return new EntityIteratorWrapper<>(futureRS, meta, statementWrapper, options);
    }
837933
@Override
    public Iterator<Path> iterator() {

        final List<String> tokens = tokenize(this);
        final int tokensSize = tokens.size();
        final List<Path> paths = new ArrayList<>(tokensSize);
        for (int i = 0; i < tokensSize; i++) {
            ArchivePath newPath = ArchivePaths.root();
            for (int j = 0; j <= i; j++) {
                newPath = ArchivePaths.create(newPath, tokens.get(j));
            }
            paths.add(new ShrinkWrapPath(newPath, this.fileSystem));
        }

        return paths.iterator();
    }
856229
public Iterator iterator()
        {
        Query readAll = m_em.createQuery(
                createReadAllQuery(m_entityClass.getSimpleName()));
        return new JpaIterator(readAll, m_batchSize);
        }
534360
@Override
    public Iterator<Action> iterator() {
        Set<Action> sorted = new TreeSet<>(startFirstComparator);
        sorted.addAll(actions);
        return sorted.iterator();
    }
1305870
@Override
	public Iterator<Class> getClassesToDeleteIterator() {
		if (fixture instanceof CleanableFixture) {
			return cleanableFixture().getClassesToDeleteIterator();
		}

		return Collections.<Class>emptyList().iterator();
	}
64605
@Override
	public final MutableObjectIterator<T> getIterator() {
		final SingleSegmentInputView startIn = new SingleSegmentInputView(this.recordsPerSegment * this.recordSize);
		startIn.set(this.sortBuffer.get(0), 0);
		
		return new MutableObjectIterator<T>() {
			
			private final SingleSegmentInputView in = startIn;
			private final TypeComparator<T> comp = comparator;
			
			private final int numTotal = size();
			private final int numPerSegment = recordsPerSegment;
			
			private int currentTotal = 0;
			private int currentInSegment = 0;
			private int currentSegmentIndex = 0;

			@Override
			public T next(T reuse) {
				if (this.currentTotal < this.numTotal) {
					
					if (this.currentInSegment >= this.numPerSegment) {
						this.currentInSegment = 0;
						this.currentSegmentIndex++;
						this.in.set(sortBuffer.get(this.currentSegmentIndex), 0);
					}
					
					this.currentTotal++;
					this.currentInSegment++;
					
					try {
						return this.comp.readWithKeyDenormalization(reuse, this.in);
					}
					catch (IOException ioe) {
						throw new RuntimeException(ioe);
					}
				}
				else {
					return null;
				}
			}

			@Override
			public T next() {
				if (this.currentTotal < this.numTotal) {

					if (this.currentInSegment >= this.numPerSegment) {
						this.currentInSegment = 0;
						this.currentSegmentIndex++;
						this.in.set(sortBuffer.get(this.currentSegmentIndex), 0);
					}

					this.currentTotal++;
					this.currentInSegment++;

					try {
						return this.comp.readWithKeyDenormalization(serializer.createInstance(), this.in);
					}
					catch (IOException ioe) {
						throw new RuntimeException(ioe);
					}
				}
				else {
					return null;
				}
			}
		};
	}
348989
@Override
  public Iterator<Entry<String, String>> iterator() {
    // Get a copy of just the string to string pairs. After the old object
    // methods that allow non-strings to be put into configurations are removed,
    // we could replace properties with a Map<String,String> and get rid of this
    // code.
    Map<String,String> result = new HashMap<String,String>();
    for(Entry<Object,Object> item: getProps().entrySet()) {
      if (item.getKey() instanceof String &&
          item.getValue() instanceof String) {
          result.put((String) item.getKey(), (String) item.getValue());
      }
    }
    return result.entrySet().iterator();
  }
413817
@Override
    public Iterator<Object> iterator() {
        return new Iterator<Object>() {

            int currentPosition = 0;

            @Override
            public boolean hasNext() {
                return masterSequence.size() > currentPosition;
            }

            @Override
            public Object next() {
                if (currentPosition <= masterSequence.size())
                    return masterSequence.get(currentPosition++);
                return null;
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException("Remove is not supported.");

            }

        };
    }
169976
@Override
    public Iterator<E> iterator() {
        return new Iterator<E>() {

            /**
             * The index to indicate the current position
             * of this iterator.
             *
             * The starting point is set to the current
             * value of this stream's offset, so that it
             * doesn't iterate over consumed elements.
             */
            private int index = offset;

            /**
             * {@inheritDoc}
             */
            @Override
            public boolean hasNext() {
                return index < elements.length;
            }

            /**
             * {@inheritDoc}
             */
            @Override
            public E next() {
                if (index >= elements.length) {
                    throw new NoSuchElementException();
                }
                return elements[index++];
            }

            /**
             * {@inheritDoc}
             */
            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }
1163488
public synchronized Iterator iterator()
   {
		if (tc.isEntryEnabled()) SibTr.entry(this, tc, "iterator");
      Iterator returnValue = idToConvTable.values().iterator();
		if (tc.isEntryEnabled()) SibTr.exit(this, tc, "iterator", returnValue);
   	return returnValue;
   }