📄 vector.html
字号:
<BR> Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Vector.html#toArray()">toArray</A></B>()</CODE><BR> Returns an array containing all of the elements in this Vector in the correct order.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/Vector.html#toArray(java.lang.Object[])">toArray</A></B>(<A HREF="../../java/lang/Object.html">Object</A>[] a)</CODE><BR> Returns an array containing all of the elements in this Vector in the correct order.</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, containing the String representation of each element.</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.util.AbstractList"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.util.<A HREF="../../java/util/AbstractList.html">AbstractList</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/util/AbstractList.html#iterator()">iterator</A>, <A HREF="../../java/util/AbstractList.html#listIterator()">listIterator</A>, <A HREF="../../java/util/AbstractList.html#listIterator(int)">listIterator</A></CODE></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#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</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> <A NAME="methods_inherited_from_class_java.util.List"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface java.util.<A HREF="../../java/util/List.html">List</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/util/List.html#iterator()">iterator</A>, <A HREF="../../java/util/List.html#listIterator()">listIterator</A>, <A HREF="../../java/util/List.html#listIterator(int)">listIterator</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, and is at least large enough to contain all the vector's elements.<p> Any array elements following the last element in the Vector are null.</DL><HR><A NAME="elementCount"><!-- --></A><H3>elementCount</H3><PRE>protected int <B>elementCount</B></PRE><DL><DD>The number of valid components in this <tt>Vector</tt> object. Components <tt>elementData[0]</tt> through <tt>elementData[elementCount-1]</tt> are the actual items.</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 less than or equal to zero, the capacity of the vector is doubled each time it needs to grow.</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 and with its capacity increment equal to zero.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - the initial capacity of the vector.<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()"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>()</PRE><DL><DD>Constructs an empty vector so that its internal data array has size <tt>10</tt> and its standard capacity increment is zero.</DL><HR><A NAME="Vector(java.util.Collection)"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>(<A HREF="../../java/util/Collection.html">Collection</A> c)</PRE><DL><DD>Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.<DD><DL><DT><B>Parameters:</B><DD><CODE>c</CODE> - the collection whose elements are to be placed into this vector.<DT><B>Since: </B><DD>1.2</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 item at index <tt>k</tt> in this vector is copied into component <tt>k</tt> of <tt>anArray</tt>. The array must be big enough to hold all the objects in this vector, else an <tt>IndexOutOfBoundsException</tt> is thrown.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anArray</CODE> - the array into which the components get copied.</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. If the capacity of this cector is larger than its current size, then the capacity is changed to equal the size by replacing its internal data array, kept in the field <tt>elementData</tt>, with a smaller one. An application can use this operation to minimize the storage of a vector.<DD><DL></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. <p>If the current capacity of this vector is less than <tt>minCapacity</tt>, then its capacity is increased by replacing its internal data array, kept in the field <tt>elementData</tt>, with a larger one. The size of the new data array will be the old size plus <tt>capacityIncrement</tt>, unless the value of <tt>capacityIncrement</tt> is less than or equal to zero, in which case the new capacity will be twice the old capacity; but if this new size is still smaller than <tt>minCapacity</tt>, then the new capacity will be <tt>minCapacity</tt>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>minCapacity</CODE> - the desired minimum capacity.</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></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newSize</CODE> - the new size of this vector.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html">ArrayIndexOutOfBoundsException</A></CODE> - if new size is negative.</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></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current capacity (the length of its internal data arary, kept in the field <tt>elementData</tt>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -