/** *Aniteratoroveracollection.{@codeIterator}takestheplaceof *{@linkEnumeration}intheJavaCollectionsFramework.Iterators *differfromenumerationsintwoways: * *<ul> *<li>Iteratorsallowthecallertoremoveelementsfromthe *underlyingcollectionduringtheiterationwithwell-defined *semantics. *<li>Methodnameshavebeenimproved. *</ul> * *<p>Thisinterfaceisamemberofthe *<ahref="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework"> *JavaCollectionsFramework</a>. * *@apiNote *An{@linkEnumeration}canbeconvertedintoan{@codeIterator}by *usingthe{@linkEnumeration#asIterator}method. * *@param<E>thetypeofelementsreturnedbythisiterator * *@authorJoshBloch *@seeCollection *@seeListIterator *@seeIterable *@since1.2
*/ publicinterface Iterator<E> {
*
* Returns {@code true} if the iteration has more elements.
* (In other words, returns {@code true} if {@link #next} would
* return an element rather than throwing an exception.)
*
* @return {@code true} if the iteration has more elements
*/ boolean hasNext();
/** *Returnsthenextelementintheiteration. * *@returnthenextelementintheiteration *@throwsNoSuchElementExceptioniftheiterationhasnomoreelements
*/
E next();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.