swarm.collections.foreach.protocol.html

来自「set for Swarm2.1是圣菲研究院的开发人员对Swarm的特性及其使用」· HTML 代码 · 共 325 行

HTML
325
字号
<HTML><HEAD><TITLE>ForEach</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="DefaultMember"HREF="swarm.collections.defaultmember.protocol.html"><LINKREL="NEXT"TITLE="ForEachKey"HREF="swarm.collections.foreachkey.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.defaultmember.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.foreachkey.protocol.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SWARM.COLLECTIONS.FOREACH.PROTOCOL">ForEach</A></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN6641"></A><H2>Name</H2>ForEach&nbsp;--&nbsp; Messages for performing the same message on objects in a collection.</DIV><DIVCLASS="REFSECT1"><ANAME="AEN6644"></A><H2>Description</H2><P> The forEach messages supply a convenient shorthand for repeatedly performing the same message on all objects contained as members in a collection.  The message to be sent is identified by the argument aSelector.  This selector must define the same number of arguments as contained in any remaining argument slots of the forEach message.  The argument types of the message to be sent must be either the id type, or some other type that will fit in the same number of bits as the id type.  By global portability assumptions, the argument type could be as large as an int (signed or unsigned), but not necessarily as large as a long.  To use the message, any non-id value must be cast to the id type as part of the call expression.</P><P> The forEach: messages are implemented by a simple loop through all members of a collection, using an internal, temporary index.  If any operation more complex than a simple message send is required, this operation should just be coded directly using a loop that traverses its own index.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN6648"></A><H2>Protocols adopted by ForEach</H2><P>None</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN6651"></A><H2>Methods</H2><DIVCLASS="REFSECT2"><ANAME="AEN6653"></A><H3>Phase: Using</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.FOREACH.METHOD.PU.M282"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">forEach:</B> (SEL)<VARCLASS="PDPARAM">aSelector</VAR> <BR><P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.FOREACH.METHOD.PU.M283"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">forEach:</B> (SEL)<VARCLASS="PDPARAM">aSelector</VAR> <BCLASS="FUNCPROTOTYPE">:</B> <VARCLASS="PDPARAM">arg1</VAR> <BR><P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.FOREACH.METHOD.PU.M284"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">forEach:</B> (SEL)<VARCLASS="PDPARAM">aSelector</VAR> <BCLASS="FUNCPROTOTYPE">:</B> <VARCLASS="PDPARAM">arg1</VAR> <BCLASS="FUNCPROTOTYPE">:</B> <VARCLASS="PDPARAM">arg2</VAR> <BR><P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.FOREACH.METHOD.PU.M285"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">forEach:</B> (SEL)<VARCLASS="PDPARAM">aSelector</VAR> <BCLASS="FUNCPROTOTYPE">:</B> <VARCLASS="PDPARAM">arg1</VAR> <BCLASS="FUNCPROTOTYPE">:</B> <VARCLASS="PDPARAM">arg2</VAR> <BCLASS="FUNCPROTOTYPE">:</B> <VARCLASS="PDPARAM">arg3</VAR> <BR><P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.FOREACH.METHOD.PU.M249"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">describeForEach:</B> <VARCLASS="PDPARAM">outputCharStream</VAR> <BR><P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.COLLECTIONS.FOREACH.METHOD.PU.M250"></A><P></P>- (void)<BCLASS="FUNCPROTOTYPE">describeForEachID:</B> <VARCLASS="PDPARAM">outputCharStream</VAR> <BR><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.defaultmember.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.foreachkey.protocol.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">DefaultMember</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="swarm.collections.sgml.reference.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">ForEachKey</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?