📄 vector.html
字号:
<BR>
Returns the index of the last occurrence of the specified object in this vector.</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="../../java/util/Vector.html#lastIndexOf(java.lang.Object, int)">lastIndexOf</A></B>(<A HREF="../../java/lang/Object.html">Object</A> elem, int index)</CODE>
<BR>
Searches backwards for the specified object, starting from the specified index, and returns an index to it.</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="../../java/util/Vector.html#removeAllElements()">removeAllElements</A></B>()</CODE>
<BR>
Removes all components from this vector and sets its size to zero.</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="../../java/util/Vector.html#removeElement(java.lang.Object)">removeElement</A></B>(<A HREF="../../java/lang/Object.html">Object</A> obj)</CODE>
<BR>
Removes the first occurrence of the argument from this vector.</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="../../java/util/Vector.html#removeElementAt(int)">removeElementAt</A></B>(int index)</CODE>
<BR>
Deletes the component at the specified index.</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="../../java/util/Vector.html#setElementAt(java.lang.Object, int)">setElementAt</A></B>(<A HREF="../../java/lang/Object.html">Object</A> obj, int index)</CODE>
<BR>
Sets the component at the specified <code>index</code> of this vector to be the specified object.</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="../../java/util/Vector.html#setSize(int)">setSize</A></B>(int newSize)</CODE>
<BR>
Sets the size of this vector.</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="../../java/util/Vector.html#size()">size</A></B>()</CODE>
<BR>
Returns the number of components in this vector.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/util/Vector.html#toString()">toString</A></B>()</CODE>
<BR>
Returns a string representation of this vector.</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="../../java/util/Vector.html#trimToSize()">trimToSize</A></B>()</CODE>
<BR>
Trims the capacity of this vector to be the vector's current size.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="elementData"><!-- --></A><H3>
elementData</H3>
<PRE>
protected <A HREF="../../java/lang/Object.html">Object</A>[] <B>elementData</B></PRE>
<DL>
<DD>The array buffer into which the components of the vector are stored. The capacity of the vector is the length of this array buffer.<DD><DL>
<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="elementCount"><!-- --></A><H3>
elementCount</H3>
<PRE>
protected int <B>elementCount</B></PRE>
<DL>
<DD>The number of valid components in the vector.<DD><DL>
<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="capacityIncrement"><!-- --></A><H3>
capacityIncrement</H3>
<PRE>
protected int <B>capacityIncrement</B></PRE>
<DL>
<DD>The amount by which the capacity of the vector is automatically incremented when its size becomes greater than its capacity. If the capacity increment is <code>0</code>, the capacity of the vector is doubled each time it needs to grow.<DD><DL>
<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Vector(int, int)"><!-- --></A><H3>
Vector</H3>
<PRE>
public <B>Vector</B>(int initialCapacity, int capacityIncrement)</PRE>
<DL>
<DD>Constructs an empty vector with the specified initial capacity and capacity increment.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity of the vector.<DD><CODE>capacityIncrement</CODE> - the amount by which the capacity is increased when the vector overflows.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the specified initial capacity is negative</DL>
</DD>
</DL>
<HR>
<A NAME="Vector(int)"><!-- --></A><H3>
Vector</H3>
<PRE>
public <B>Vector</B>(int initialCapacity)</PRE>
<DL>
<DD>Constructs an empty vector with the specified initial capacity.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity of the vector.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="Vector()"><!-- --></A><H3>
Vector</H3>
<PRE>
public <B>Vector</B>()</PRE>
<DL>
<DD>Constructs an empty vector.<DD><DL>
<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="copyInto(java.lang.Object[])"><!-- --></A><H3>
copyInto</H3>
<PRE>
public void <B>copyInto</B>(<A HREF="../../java/lang/Object.html">Object</A>[] anArray)</PRE>
<DL>
<DD>Copies the components of this vector into the specified array. The array must be big enough to hold all the objects in this vector.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>anArray</CODE> - the array into which the components get copied.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="trimToSize()"><!-- --></A><H3>
trimToSize</H3>
<PRE>
public void <B>trimToSize</B>()</PRE>
<DL>
<DD>Trims the capacity of this vector to be the vector's current size. An application can use this operation to minimize the storage of a vector.<DD><DL>
<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="ensureCapacity(int)"><!-- --></A><H3>
ensureCapacity</H3>
<PRE>
public void <B>ensureCapacity</B>(int minCapacity)</PRE>
<DL>
<DD>Increases the capacity of this vector, if necessary, to ensure that it can hold at least the number of components specified by the minimum capacity argument.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>minCapacity</CODE> - the desired minimum capacity.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setSize(int)"><!-- --></A><H3>
setSize</H3>
<PRE>
public void <B>setSize</B>(int newSize)</PRE>
<DL>
<DD>Sets the size of this vector. If the new size is greater than the current size, new <code>null</code> items are added to the end of the vector. If the new size is less than the current size, all components at index <code>newSize</code> and greater are discarded.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newSize</CODE> - the new size of this vector.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="capacity()"><!-- --></A><H3>
capacity</H3>
<PRE>
public int <B>capacity</B>()</PRE>
<DL>
<DD>Returns the current capacity of this vector.<DD><DL>
<DT><B>Returns:</B><DD>the current capacity of this vector.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Returns the number of components in this vector.<DD><DL>
<DT><B>Returns:</B><DD>the number of components in this vector.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="isEmpty()"><!-- --></A><H3>
isEmpty</H3>
<PRE>
public boolean <B>isEmpty</B>()</PRE>
<DL>
<DD>Tests if this vector has no components.<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if this vector has no components; <code>false</code> otherwise.<DT><B>Since: </B><DD>JDK1.0</DD>
</DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -