vector.html
来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 1,278 行 · 第 1/5 页
HTML
1,278 行
<CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#addElement(E)">addElement</A></B>(<A HREF="Vector.html" title="Vector 中的类型参数">E</A> obj)</CODE><BR> 将指定的组件添加到此向量的末尾,且向量的大小加 1。</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="Vector.html#capacity()">capacity</A></B>()</CODE><BR> 返回此向量的当前容量。</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="Vector.html#clear()">clear</A></B>()</CODE><BR> 从此向量中移除所有元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../lang/Object.html" title="java.lang 中的类">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#clone()">clone</A></B>()</CODE><BR> 返回向量的一个副本。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#contains(java.lang.Object)">contains</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> elem)</CODE><BR> 测试指定的对象是否为此向量中的组件。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#containsAll(java.util.Collection)">containsAll</A></B>(<A HREF="Collection.html" title="java.util 中的接口">Collection</A><?> c)</CODE><BR> 如果此向量包含指定 Collection 中的所有元素,则返回 true。</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="Vector.html#copyInto(java.lang.Object[])">copyInto</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A>[] anArray)</CODE><BR> 将此向量的组件复制到指定的数组中。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Vector.html" title="Vector 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#elementAt(int)">elementAt</A></B>(int index)</CODE><BR> 返回指定索引处的组件。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Enumeration.html" title="java.util 中的接口">Enumeration</A><<A HREF="Vector.html" title="Vector 中的类型参数">E</A>></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#elements()">elements</A></B>()</CODE><BR> 返回此向量的组件的枚举。</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="Vector.html#ensureCapacity(int)">ensureCapacity</A></B>(int minCapacity)</CODE><BR> 增加此向量的容量(如有必要),以确保其至少能够保存最小容量参数指定的组件数。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> o)</CODE><BR> 比较指定对象与此向量的相等性。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Vector.html" title="Vector 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#firstElement()">firstElement</A></B>()</CODE><BR> 返回此向量的第一个组件(位于索引 <tt>0</tt> 处的项)。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Vector.html" title="Vector 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#get(int)">get</A></B>(int index)</CODE><BR> 返回向量中指定位置的元素。</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="Vector.html#hashCode()">hashCode</A></B>()</CODE><BR> 返回此向量的哈希代码值。</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="Vector.html#indexOf(java.lang.Object)">indexOf</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> elem)</CODE><BR> 搜索给定参数的第一个匹配项,使用 <code>equals</code> 方法测试相等性。</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="Vector.html#indexOf(java.lang.Object, int)">indexOf</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> elem, int index)</CODE><BR> 搜索给定参数的第一个匹配项,从 <code>index</code> 处开始搜索,并使用 <code>equals</code> 方法测试其相等性。</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="Vector.html#insertElementAt(E, int)">insertElementAt</A></B>(<A HREF="Vector.html" title="Vector 中的类型参数">E</A> obj, int index)</CODE><BR> 将指定对象作为此向量中的组件插入到指定的 <code>index</code> 处。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#isEmpty()">isEmpty</A></B>()</CODE><BR> 测试此向量是否不包含组件。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Vector.html" title="Vector 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#lastElement()">lastElement</A></B>()</CODE><BR> 返回此向量的最后一个组件。</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="Vector.html#lastIndexOf(java.lang.Object)">lastIndexOf</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> elem)</CODE><BR> 返回指定的对象在此向量中最后一个匹配项的索引。</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="Vector.html#lastIndexOf(java.lang.Object, int)">lastIndexOf</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> elem, int index)</CODE><BR> 向后搜索指定的对象,从指定的索引处开始,并返回其对应的某个索引。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Vector.html" title="Vector 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#remove(int)">remove</A></B>(int index)</CODE><BR> 移除此向量中指定位置的元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#remove(java.lang.Object)">remove</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> o)</CODE><BR> 移除此向量中指定元素的第一个匹配项,如果向量不包含该元素,则元素保持不变。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#removeAll(java.util.Collection)">removeAll</A></B>(<A HREF="Collection.html" title="java.util 中的接口">Collection</A><?> c)</CODE><BR> 从此向量中移除包含在指定 Collection 中的所有元素。</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="Vector.html#removeAllElements()">removeAllElements</A></B>()</CODE><BR> 从此向量中移除全部组件,并将其大小设置为零。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#removeElement(java.lang.Object)">removeElement</A></B>(<A HREF="../lang/Object.html" title="java.lang 中的类">Object</A> obj)</CODE><BR> 从此向量中移除变量的第一个(索引最小的)匹配项。</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="Vector.html#removeElementAt(int)">removeElementAt</A></B>(int index)</CODE><BR> 删除指定索引处的组件。</TD></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="Vector.html#removeRange(int, int)">removeRange</A></B>(int fromIndex, int toIndex)</CODE><BR> 从此 List 中移除其索引位于 fromIndex(包括)与 toIndex(不包括)之间的所有元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#retainAll(java.util.Collection)">retainAll</A></B>(<A HREF="Collection.html" title="java.util 中的接口">Collection</A><?> c)</CODE><BR> 在此向量中仅保留包含在指定 Collection 中的元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="Vector.html" title="Vector 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="Vector.html#set(int, E)">set</A></B>(int index, <A HREF="Vector.html" title="Vector 中的类型参数">E</A> element)</CODE><BR> 用指定的元素替换此向量中指定位置处的元素。</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="Vector.html#setElementAt(E, int)">setElementAt</A></B>(<A HREF="Vector.html" title="Vector 中的类型参数">E</A> obj, int index)</CODE><BR> 将此向量指定 <code>index</code> 处的组件设置为指定的对象。</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="Vector.html#setSize(int)">setSize</A></B>(int newSize)</CODE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?