📄 array.html
字号:
<PRE>
public static <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A> <B>from</B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> iterable)</PRE>
<DL>
<DD>将任何的可枚举(iterable)类型对象转换成Array对象。 prototype增强方法
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>iterable</CODE> -
<DT><B>返回:</B><DD>Array <p><b>Example:</b></p><pre> function test(){ var args = $A(arguments); alert(args); //1,2,3,4 alert(arguments); //object } test(1,2,3,"4");</pre></DL>
</DD>
</DL>
<HR>
<A NAME="_reverse()"><!-- --></A><H3>
_reverse</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>> <B>_reverse</B>()</PRE>
<DL>
<DD>prototype增强方法
<P>
<DD><DL>
<DT><B>返回:</B><DD>Array<DT><B>另请参见:</B><DD><A HREF="../../../net/conic/prototype/Array.html#reverse()"><CODE>reverse()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD>清除 当前数组对象 的内的所有对象,并且this.length=0; prototype增强方法
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="first()"><!-- --></A><H3>
first</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A> <B>first</B>()</PRE>
<DL>
<DD>返回 当前数组对象 的第一个元素。 prototype增强方法
<P>
<DD><DL>
<DT><B>返回:</B><DD>返回 当前数组对象 的第一个元素的值</DL>
</DD>
</DL>
<HR>
<A NAME="last()"><!-- --></A><H3>
last</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A> <B>last</B>()</PRE>
<DL>
<DD>返回 当前数组对象 的最后一个元素
<P>
<DD><DL>
<DT><B>返回:</B><DD>返回 当前数组对象 的最后一个元素的值</DL>
</DD>
</DL>
<HR>
<A NAME="compact()"><!-- --></A><H3>
compact</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>> <B>compact</B>()</PRE>
<DL>
<DD>返回 当前数组对象 的紧凑模式,具体看Example。 prototype增强方法
<P>
<DD><DL>
<DT><B>返回:</B><DD>Array <p><b>Example:</b></p><pre> var a = []; a[0] = "aaa"; a[10] = "bbb"; alert(a); //a.length=11 alert(a.compact()); //a.length=2</pre></DL>
</DD>
</DL>
<HR>
<A NAME="flatten()"><!-- --></A><H3>
flatten</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>> <B>flatten</B>()</PRE>
<DL>
<DD>将一个多维的数组并成一维数组;prototype增强方法,源码实现比较灵活
<P>
<DD><DL>
<DT><B>返回:</B><DD>一个一维的数组<p><b>Example:</b></p><pre> var aa = [[1,2,3],[4,5,6],[7,8,9]]; alert(aa.length); //length = 3 alert(aa.flatten().length);//length = 9</pre></DL>
</DD>
</DL>
<HR>
<A NAME="without(net.conic.prototype.Object...)"><!-- --></A><H3>
without</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>> <B>without</B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A>... extractObject)</PRE>
<DL>
<DD>将 当前数组对象 其中不包含所传入的excludeObject值的那部分内容返回。 prototype增强方法
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>extractObject</CODE> - 变长参数
<DT><B>返回:</B><DD>Array<V> <p><b>Example:</b></p><pre> var aa = [1,2,3,7,8,9]; alert(aa.without(1,2,3)); //result:7,8,9</pre></DL>
</DD>
</DL>
<HR>
<A NAME="indexOf(net.conic.prototype.Object)"><!-- --></A><H3>
indexOf</H3>
<PRE>
public int <B>indexOf</B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> obj)</PRE>
<DL>
<DD>数组的indexOf方法。 prototype增强方法
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>obj</CODE> - 要查找的对象
<DT><B>返回:</B><DD>返回查找对象在数组中第一次出现的索引位置,找不到返回-1;</DL>
</DD>
</DL>
<HR>
<A NAME="reverse(boolean)"><!-- --></A><H3>
reverse</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A> <B>reverse</B>(boolean flag)</PRE>
<DL>
<DD>返回元素顺序被反转的 Array 对象。 prototype增强方法
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>flag</CODE> - 此参数决定是否影响对象本身的内容。true-有影响;false-不影响; <p>另外,如果想让此参数起作用,则必须是一个boolean类型的对象。 true|false
<DT><B>返回:</B><DD>返回一个元素顺序被反转的 Array 对象。 <p><b>Example:</b></p><pre> var aa = [1,2,3]; alert(aa.reverse(false)); //3,2,1 alert(aa); //不受影响: 1,2,3 alert(aa.reverse(true)); //3,2,1 alert(aa); //受3,2,1</pre></DL>
</DD>
</DL>
<HR>
<A NAME="shift()"><!-- --></A><H3>
shift</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A> <B>shift</B>()</PRE>
<DL>
<DD>数组向左边推移一位,将左边第一个位置的成员挤出去。 prototype增强方法
<P>
<DD><DL>
<DT><B>返回:</B><DD>被移除掉的成员对象 <p><b>Example:</b></p><pre> var aa = [1,2,3]; alert(aa.shift()); //1 alert(aa); //2,3</pre></DL>
</DD>
</DL>
<HR>
<A NAME="inspect()"><!-- --></A><H3>
inspect</H3>
<PRE>
public <A HREF="../../../net/conic/prototype/String.html" title="net.conic.prototype 中的类">String</A> <B>inspect</B>()</PRE>
<DL>
<DD>将数组成员内容组织成一个字符串返回。 prototype增强方法
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE><A HREF="../../../net/conic/prototype/Enumerable.html" title="net.conic.prototype 中的类">Enumerable</A></CODE> 中的 <CODE><A HREF="../../../net/conic/prototype/Enumerable.html#inspect()">inspect</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>返回:</B><DD>String</DL>
</DD>
</DL>
<HR>
<A NAME="_each(net.conic.prototype.IteratorAdapter)"><!-- --></A><H3>
_each</H3>
<PRE>
protected void <B>_each</B>(<A HREF="../../../net/conic/prototype/IteratorAdapter.html" title="net.conic.prototype 中的类">IteratorAdapter</A> each)</PRE>
<DL>
<DD><B>从类 <CODE><A HREF="../../../net/conic/prototype/Enumerable.html#_each(net.conic.prototype.IteratorAdapter)">Enumerable</A></CODE> 复制的描述</B></DD>
<DD>执行each()方法时内部遍历操作都将执行此方法 ,此方法在prototype的源码中并未在Enumerable对象上做定义 ,在这里用java语言特性定义成protected abstract就是为了重点说明需要继承使用Enumerable特性的JS子类必须实现此方法!
<P>
<DD><DL>
<DT><B>指定者:</B><DD>类 <CODE><A HREF="../../../net/conic/prototype/Enumerable.html" title="net.conic.prototype 中的类">Enumerable</A></CODE> 中的 <CODE><A HREF="../../../net/conic/prototype/Enumerable.html#_each(net.conic.prototype.IteratorAdapter)">_each</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>参数:</B><DD><CODE>each</CODE> - function</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Array.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</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="../../../net/conic/prototype/Boolean.html" title="net.conic.prototype 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/conic/prototype/Array.html" target="_top"><B>框架</B></A>
<A HREF="Array.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | <A HREF="#field_summary">字段</A> | <A HREF="#constructor_summary">构造函数</A> | <A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: <A HREF="#field_detail">字段</A> | <A HREF="#constructor_detail">构造函数</A> | <A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -