📄 array.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_06) on Sun Feb 19 02:37:46 CST 2006 -->
<TITLE>
Array
</TITLE>
<META NAME="keywords" CONTENT="net.conic.prototype.Array class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Array";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_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_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
net.conic.prototype</FONT>
<BR>
类 Array<V></H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">net.conic.prototype.Object</A>
<IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><A HREF="../../../net/conic/prototype/Enumerable.html" title="net.conic.prototype 中的类">net.conic.prototype.Enumerable</A>
<IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><B>net.conic.prototype.Array<V></B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Array<V></B><DT>extends <A HREF="../../../net/conic/prototype/Enumerable.html" title="net.conic.prototype 中的类">Enumerable</A></DL>
</PRE>
<P>
JS的数组对象,已被prototype增强.
<P>
<P>
<DL>
<DT><B>版本:</B></DT>
<DD>Prototype Document Version 0.1</DD>
<DT><B>作者:</B></DT>
<DD>Frank.Chen (Email:jtjdskq@126.com) <br>http://blog.csdn.net/jkjdskq</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>字段摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#constructor">constructor</A></B></CODE>
<BR>
JS中类型实例的构造方法的引用,每个JS的类对象都自动内部绑定此属性</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#length">length</A></B></CODE>
<BR>
返回一个整数值,这个整数比数组中所定义的最高位元素的下标大 1 length 属性包含一个整数,用来指出 String 对象中的字符数。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../net/conic/prototype/JSClass.html" title="net.conic.prototype 中的接口">JSClass</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#prototype">prototype</A></B></CODE>
<BR>
返回JS类型原型的引用,每个JS的类对象都自动内部绑定此属性</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>构造函数摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#Array()">Array</A></B>()</CODE>
<BR>
默认构造方法</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#Array(int)">Array</A></B>(int size)</CODE>
<BR>
初始化一个指定长度的数组</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#Array(V...)">Array</A></B>(<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>... elements)</CODE>
<BR>
初始化带值的数组对象</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>方法摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#_each(net.conic.prototype.IteratorAdapter)">_each</A></B>(<A HREF="../../../net/conic/prototype/IteratorAdapter.html" title="net.conic.prototype 中的类">IteratorAdapter</A> each)</CODE>
<BR>
执行each()方法时内部遍历操作都将执行此方法 ,此方法在prototype的源码中并未在Enumerable对象上做定义 ,在这里用java语言特性定义成protected abstract就是为了重点说明需要继承使用Enumerable特性的JS子类必须实现此方法!</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#_reverse()">_reverse</A></B>()</CODE>
<BR>
prototype增强方法</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="../../../net/conic/prototype/Array.html#clear()">clear</A></B>()</CODE>
<BR>
清除 当前数组对象 的内的所有对象,并且this.length=0; prototype增强方法</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#compact()">compact</A></B>()</CODE>
<BR>
返回 当前数组对象 的紧凑模式,具体看Example。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#concat(net.conic.prototype.Array)">concat</A></B>(<A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>> array2)</CODE>
<BR>
返回一个新数组,这个新数组是由两个数组组合而成的。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#first()">first</A></B>()</CODE>
<BR>
返回 当前数组对象 的第一个元素。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#flatten()">flatten</A></B>()</CODE>
<BR>
将一个多维的数组并成一维数组;prototype增强方法,源码实现比较灵活</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#from(net.conic.prototype.Object)">from</A></B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> iterable)</CODE>
<BR>
将任何的可枚举(iterable)类型对象转换成Array对象。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#indexOf(net.conic.prototype.Object)">indexOf</A></B>(<A HREF="../../../net/conic/prototype/Object.html" title="net.conic.prototype 中的类">Object</A> obj)</CODE>
<BR>
数组的indexOf方法。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/String.html" title="net.conic.prototype 中的类">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#inspect()">inspect</A></B>()</CODE>
<BR>
将数组成员内容组织成一个字符串返回。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/String.html" title="net.conic.prototype 中的类">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#join(net.conic.prototype.String)">join</A></B>(<A HREF="../../../net/conic/prototype/String.html" title="net.conic.prototype 中的类">String</A> separator)</CODE>
<BR>
返回一个 String 对象,这个字符串对象是由整个数组的所有元素连接在一起而形成的。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#last()">last</A></B>()</CODE>
<BR>
返回 当前数组对象 的最后一个元素</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../net/conic/prototype/Array.html" title="net.conic.prototype 中的类">Array</A><<A HREF="../../../net/conic/prototype/Array.html" title="Array 中的类型参数">V</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/conic/prototype/Array.html#reverse()">reverse</A></B>()</CODE>
<BR>
返回元素顺序被反转的 Array 对象。</TD>
</TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -