?? abstractiterator.html
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Aug 23 13:18:10 EDT 2002 --><TITLE>: Class AbstractIterator</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><a href=../copyright.html target=_top>© 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../structure/AbstractLinear.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="AbstractIterator.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">structure</FONT><BR>Class AbstractIterator</H2><PRE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">java.lang.Object</A> | +--<B>structure.AbstractIterator</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html">Enumeration</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../structure/AbstractListIterator.html">AbstractListIterator</A>, <A HREF="../structure/ArrayIterator.html">ArrayIterator</A>, <A HREF="../structure/BTInorderIterator.html">BTInorderIterator</A>, <A HREF="../structure/BTLevelorderIterator.html">BTLevelorderIterator</A>, <A HREF="../structure/BTPostorderIterator.html">BTPostorderIterator</A>, <A HREF="../structure/BTPreorderIterator.html">BTPreorderIterator</A>, <A HREF="../structure/ChainedHashtableIterator.html">ChainedHashtableIterator</A>, <A HREF="../structure/CircularListIterator.html">CircularListIterator</A>, <A HREF="../structure/DoublyLinkedListIterator.html">DoublyLinkedListIterator</A>, <A HREF="../structure/GraphListAIterator.html">GraphListAIterator</A>, <A HREF="../structure/GraphListEIterator.html">GraphListEIterator</A>, <A HREF="../structure/HashtableIterator.html">HashtableIterator</A>, <A HREF="../structure/KeyIterator.html">KeyIterator</A>, <A HREF="../structure/RedBlackIterator.html">RedBlackIterator</A>, <A HREF="../structure/SinglyLinkedListIterator.html">SinglyLinkedListIterator</A>, <A HREF="../structure/SplayTreeIterator.html">SplayTreeIterator</A>, <A HREF="../structure/ValueIterator.html">ValueIterator</A>, <A HREF="../structure/VectorIterator.html">VectorIterator</A></DD></DL><HR><DL><DT>public abstract class <B>AbstractIterator</B><DT>extends <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A><DT>implements <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html">Enumeration</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A></DL><P>Abstract base class for portable iterator and enumeration implementation. <p> A general purpose iterator that implements both java.util.Iterator and java.util.Enumeration. This class also implements the <A HREF="../structure/AbstractIterator.html#value()"><CODE>value()</CODE></A> method, providing multiple accesses, and the <A HREF="../structure/AbstractIterator.html#reset()"><CODE>reset()</CODE></A> method, which allows the user to restart the traversal. <p> Typical usage: <pre> <A HREF="../structure/Vector.html"><CODE>Vector</CODE></A> v = new <A HREF="../structure/package-summary.html">structure</A>; String s = "target"; ... <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html"><CODE>Iterator</CODE></A> t = v.<A HREF="../structure/Vector.html#iterator()"><CODE>iterator()</CODE></A>(); // print members of vector that are greater than s for (t.<A HREF="../structure/AbstractIterator.html#reset()"><CODE>reset</CODE></A>(); t.<A HREF="../structure/AbstractIterator.html#hasNext()"><CODE>hasNext</CODE></A>(); t.<A HREF="../structure/AbstractIterator.html#next()"><CODE>next</CODE></A>()) { if (s.compareTo(t.<A HREF="../structure/AbstractIterator.html#value()"><CODE>value</CODE></A>()) < 0) System.out.println(t.<A HREF="../structure/AbstractIterator.html#value()"><CODE>value</CODE></A>()); } </pre> <p> Users of Java's <code>Enumeration</code> or <code>Iterator</code> may treat the <code>AbstractIterator</code> as an <code>Enumeration</code> or <code>Iterator</code>, respectively, without ill effect. <p> Appropriate care should be taken to make sure that the underlying data structure is not modified while the traversal is active. Some extensions of this class may choose to provide methods that modify the structure --- the <code>remove</code> method of <code>iterator</code> modifications are carefully synchronized, or limited to one active traversal.<P><DL><DT><B>See Also: </B><DD><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html"><CODE>Iterator</CODE></A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Enumeration.html"><CODE>Enumeration</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/AbstractIterator.html#AbstractIterator()">AbstractIterator</A></B>()</CODE><BR> Default constructor (for base class invocation).</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#get()">get</A></B>()</CODE><BR> Returns the value currently being considered by the AbstractIterator.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#hasMoreElements()">hasMoreElements</A></B>()</CODE><BR> An Enumeration method that is equivalent to <A HREF="../structure/AbstractIterator.html#hasNext()"><CODE>hasNext()</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#hasNext()">hasNext</A></B>()</CODE><BR> Returns true if the iterator has more elements to visit.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#next()">next</A></B>()</CODE><BR> Moves, bumps, or "increments" the iterator along the traversal; returns the next value considered.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#nextElement()">nextElement</A></B>()</CODE><BR> An Enumeration method that is equivalent to <A HREF="../structure/AbstractIterator.html#next()"><CODE>next()</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#remove()">remove</A></B>()</CODE><BR> If implemented, removes the currently visited value from the structure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract void</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#reset()">reset</A></B>()</CODE><BR> Reset iterator to the beginning of the structure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/AbstractIterator.html#value()">value</A></B>()</CODE><BR> <B>Deprecated.</B> <I>This method was deprecated in version 2 of the structure package. Use the get method.</I></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#<clinit>()"><clinit></A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#clone()">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#finalize()">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#registerNatives()">registerNatives</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -