This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.util
interface Iterator

All Known Subinterfaces:
ListIterator, XMLEventReader
All Known Implementing Classes:
BeanContextSupport.BCSIterator, Scanner

Most common ways to construct:

ArrayList sortedMethods = …;

Iterator methodIterator = sortedMethods.iterator();

Based on 24 examples

 

Set s = …;

Iterator i = s.iterator();

Based on 21 examples


public interface Iterator

An iterator over a collection. Iterator takes the place of Enumeration in the Java collections framework. Iterators differ from enumerations in two ways:

This interface is a member of the Java Collections Framework.


Method Summary
 boolean

          Returns true if the iteration has more elements.
 Object

          Returns the next element in the iteration.
 void

          Removes from the underlying collection the last element returned by the iterator (optional operation).
 

Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:
true if the iterator has more elements.

next

public Object next()
Returns the next element in the iteration.

Returns:
the next element in the iteration.

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.



This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.