📄 swarm.collections.list.protocol.html
字号:
<HTML><HEAD><TITLE>List</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.53"><LINKREL="HOME"TITLE="Documentation Set for Swarm 2.1.1"HREF="set.html"><LINKREL="UP"TITLE="Collections Library"HREF="swarm.collections.sgml.reference.html"><LINKREL="PREVIOUS"TITLE="KeyedCollectionIndex"HREF="swarm.collections.keyedcollectionindex.protocol.html"><LINKREL="NEXT"TITLE="ListIndex"HREF="swarm.collections.listindex.protocol.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Documentation Set for Swarm 2.1.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="swarm.collections.keyedcollectionindex.protocol.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Reference II. Collections Library</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="swarm.collections.listindex.protocol.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SWARM.COLLECTIONS.LIST.PROTOCOL">List</A></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN7180"></A><H2>Name</H2>List -- Collection of members in an externally assigned linear sequence.</DIV><DIVCLASS="REFSECT1"><ANAME="AEN7183"></A><H2>Description</H2><P> A list is a collection of members that are all maintained at some externally assigned position in a linear sequence of all members. The sequence is established by the position at which members are added: members can be added at the start of list, at the end, or at any point in the middle.</P><P> A list is also one of the most dynamic of basic collections, in that the cost of adding and removing members is very low. Members can be removed from any position just as easily as they can be added. A list automatically grows and shrinks to reflect the number of members at any one time, and there is no fixed capacity which limits the size to which a list may grow.</P><P> The List type is supports all messages of Collection. If created with default options, it provides no special speedup of accesses by integer offset.</P><P> Unless the EndsOnly option is specified, the default value of IndexSafety is UnsafeAtMember. This means that indexes are inherently safe under all operations except those which affect the member at an index or immediately adjacent to an index between members. If the EndsOnly option is specified, the default value of IndexSafety is Unsafe. In this case, indexes could be invalidated by any operation that adds or removes members. The SafeAlways can be specified for any case to get a guarantee of full index safety.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN7189"></A><H2>Protocols adopted by List</H2><P> <AHREF="swarm.collections.collection.protocol.html">Collection</A> <AHREF="swarm.defobj.creatable.protocol.html">CREATABLE</A></P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN7194"></A><H2>Methods</H2><DIVCLASS="REFSECT2"><ANAME="AEN7196"></A><H3>Phase: Using</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.LIST.METHOD.PU.M87"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">addFirst:</B> <VARCLASS="PDPARAM">anObject</VAR> <BR> The addFirst: message adds a new member to the front of the list.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.LIST.METHOD.PU.M91"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">addLast:</B> <VARCLASS="PDPARAM">anObject</VAR> <BR> The addLast: message adds a new member to the end of the list.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.LIST.METHOD.PU.M638"></A><P></P>- <BCLASS="FUNCPROTOTYPE">removeFirst</B><BR> Removes the first member from the list and returns it.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.LIST.METHOD.PU.M640"></A><P></P>- <BCLASS="FUNCPROTOTYPE">removeLast</B><BR> Removes the last member from the list and returns it.<P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.LIST.METHOD.PU.M572"></A><P></P>- (id <ListIndex>)<BCLASS="FUNCPROTOTYPE">listBegin:</B> (id <Zone>)<VARCLASS="PDPARAM">aZone</VAR> <BR> Returns a ListIndex, the special index for the List type<P></P></DIV></LI></UL></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="swarm.collections.keyedcollectionindex.protocol.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="set.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="swarm.collections.listindex.protocol.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">KeyedCollectionIndex</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="swarm.collections.sgml.reference.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">ListIndex</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -