📄 index.html
字号:
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../swarm/defobj/Drop.html#drop()">drop</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_swarm.defobj.GetName"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface swarm.defobj.<A HREF="../../swarm/defobj/GetName.html">GetName</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../swarm/defobj/GetName.html#getName()">getName</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getCollection()"><!-- --></A><H3>getCollection</H3><PRE>public java.lang.Object <B>getCollection</B>()</PRE><DL><DD>getCollection returns the collection referred to by an index. This collection never changes during the lifetime of the index.<DD><DL></DL></DD></DL><HR><A NAME="next()"><!-- --></A><H3>next</H3><PRE>public java.lang.Object <B>next</B>()</PRE><DL><DD>The next message positions the index to the next valid member after its current position, or to a special position after the end of all valid members. In addition to repositioning the index, both messages return the new member value to which they are positioned, or nil if there is no such member.<DD><DL></DL></DD></DL><HR><A NAME="prev()"><!-- --></A><H3>prev</H3><PRE>public java.lang.Object <B>prev</B>()</PRE><DL><DD>The prev message works similarly, but positions to a valid member preceding the current position, or to a special position preceding all valid members.<DD><DL></DL></DD></DL><HR><A NAME="findNext(java.lang.Object)"><!-- --></A><H3>findNext</H3><PRE>public java.lang.Object <B>findNext</B>(java.lang.Object anObject)</PRE><DL><DD>findNext: repeatedly performs next until the member value of the index matches the argument. nil is returned if the index reaches the end of valid members without matching the argument.<DD><DL></DL></DD></DL><HR><A NAME="findPrev(java.lang.Object)"><!-- --></A><H3>findPrev</H3><PRE>public java.lang.Object <B>findPrev</B>(java.lang.Object anObject)</PRE><DL><DD>findPrev: repeatedly performs prev until the member value of the index matches the argument. nil is returned if the index reaches the end of valid members without matching the argument.<DD><DL></DL></DD></DL><HR><A NAME="get()"><!-- --></A><H3>get</H3><PRE>public java.lang.Object <B>get</B>()</PRE><DL><DD>get returns the member value at which the index is currently positioned, or nil if the index is not positioned at a member. The get message provides an alternate way to obtain the current member value in a loop that traverses a collection; its return value is the same as next or prev would return when first positioning to a new member.<DD><DL></DL></DD></DL><HR><A NAME="put(java.lang.Object)"><!-- --></A><H3>put</H3><PRE>public java.lang.Object <B>put</B>(java.lang.Object anObject)</PRE><DL><DD>The put: message replaces the member value at the current index position with its argument. An InvalidIndexLoc error is raised if the index is not positioned at a current member.<DD><DL></DL></DD></DL><HR><A NAME="remove()"><!-- --></A><H3>remove</H3><PRE>public java.lang.Object <B>remove</B>()</PRE><DL><DD>The remove message removes the member at the current location of an index, and returns the member value removed. The index position is set to a special position between the members which previously preceded and followed the removed member. If there is no preceding or following member, the index is set to the special location before the start or after the end of all members. After a current member is removed, there is no member at the current index location, but a subsequent next or prev message will continue with the same member that would have been accessed had the current member not been removed. An InvalidIndexLoc error is raised if the index is not positioned at a current member.<DD><DL></DL></DD></DL><HR><A NAME="getLoc()"><!-- --></A><H3>getLoc</H3><PRE>public <A HREF="../../swarm/defobj/Symbol.html">Symbol</A> <B>getLoc</B>()</PRE><DL><DD>The getLoc message returns a symbol constant which indicates the type of location at which an index is currently positioned. This index location symbol has one of the following values: Start, End, and Member. The Start symbol indicates the special position preceding all members in the enumeration sequence for the collection. This is the location at which an index is positioned when it is first created. The End symbol indicates the special position following all members in the collection. This is the location at which an index is positioned just after a next message has returned nil, as a result of moving beyond the last member. The Member symbol indicates that the index is positioned at some current member in the enumeration sequence of a collection. The getLoc message is needed to traverse a collection which could contain nil values for its members. Without getLoc, there would be no way to distinguish a nil value returned by next as either a valid member value or the special value returned at the end of members. With getLoc, a loop that traverses a collection can test specifically for the end (or start) of members.<DD><DL></DL></DD></DL><HR><A NAME="setLoc(swarm.defobj.Symbol)"><!-- --></A><H3>setLoc</H3><PRE>public void <B>setLoc</B>(<A HREF="../../swarm/defobj/Symbol.html">Symbol</A> locSymbol)</PRE><DL><DD>The setLoc: message may be used to reset the current location of an index to either Start or End. It may be used to reprocess a collection using an existing index after some other location has already been reached. It may also be used to position an index at the end of all members prior to traversing members in reverse order using prev. Besides Start and End, setLoc: accepts the special argument values of BetweenAfter and BetweenBefore, which are also defined symbols. These argument values are only valid if the index is positioned at a current member. They reposition the index to the special location between the current member and its immediately following or preceding member.<DD><DL></DL></DD></DL><HR><A NAME="getOffset()"><!-- --></A><H3>getOffset</H3><PRE>public int <B>getOffset</B>()</PRE><DL><DD>Provided there is no major computational cost, an index also maintains the integer offset of its current member within the enumeration sequence of the collection. These integer offset values have the same definition as in the atOffset: messages of Collection. The getOffset message returns this current offset value. If the index is current positioned at the Start or End location, getOffset returns -1. If the index is positioned at a Between location, getOffset returns the offset of the immediately preceding member. If the offset is not currently available from the index, getOffset returns the special value UnknownOffset. This value is defined by a macro as the maximally negative value of a 32-bit, 2's-complement integer. An offset is always available from an index if its current position has been reached by repeated operations from an initial Start or End position, and there has been no other modification to the underlying collection. Some forms of direct member access operations supported by some index types, however, may result in an integer offset not being available. These restrictions are noted with the individual index type.<DD><DL></DL></DD></DL><HR><A NAME="setOffset(int)"><!-- --></A><H3>setOffset</H3><PRE>public java.lang.Object <B>setOffset</B>(int offset)</PRE><DL><DD>Using the setOffset: message, an index may be positioned directly to a member using the offset of the member within its enumeration sequence. The speed of this operation depends on the specific type of the collection, just as noted for the atOffset: message on Collection. In the worst case, this operation is linear in the magnitude of the offset.<DD><DL></DL></DD></DL><HR><A NAME="compare(java.lang.Object)"><!-- --></A><H3>compare</H3><PRE>public int <B>compare</B>(java.lang.Object anIndex)</PRE><DL><DD>The compare: message compares the current location of one index with the current location of another index passed as its argument. If the two indexes have the same location, compare: returns zero. Otherwise, compare: returns +1 or -1 according to whether the argument index precedes or follows the receiver index in the enumeration sequence of the collection. If either of the two indexes has an unknown offset, and the location of the other index is anything other than Start or End or an immediately adjacent member, compare: returns the UnknownOffset integer value.<DD><DL><DT><B>Specified by: </B><DD><A HREF="../../swarm/defobj/DefinedObject.html#compare(java.lang.Object)">compare</A> in interface <A HREF="../../swarm/defobj/DefinedObject.html">DefinedObject</A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="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 ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../swarm/collections/ForEachS.html"><B>PREV CLASS</B></A> <A HREF="../../swarm/collections/IndexC.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="Index.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -