⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vector.html

📁 学习JAVA的很好的JAVA包和文档包
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Vector()"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>()</PRE><DL><DD>Construct an empty vector.</DL><HR><A NAME="Vector(int)"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>(int&nbsp;initialCapacity)</PRE><DL><DD>Construct an empty vector capable of storing <code>initialCapacity</code> values before the vector must be extended.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - The size of vector before reallocation is necessary</DL></DD></DL><HR><A NAME="Vector(int, int)"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>(int&nbsp;initialCapacity,              int&nbsp;capacityIncr)</PRE><DL><DD>Construct a vector with initial capacity, and growth characteristic.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - The initial number of slots in vector.<DD><CODE>capacityIncr</CODE> - The size of growth of vector.<DT><B>See Also: </B><DD><A HREF="../structure/Vector.html#capacityIncrement"><CODE>capacityIncrement</CODE></A></DL></DD></DL><HR><A NAME="Vector(int, int, java.lang.Object)"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>(int&nbsp;initialCapacity,              int&nbsp;capacityIncr,              <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;initValue)</PRE><DL><DD>Construct a vector with initial size, growth rate and default value.<DD><DL><DT><B>Parameters:</B><DD><CODE>initialCapacity</CODE> - The initial number of slots in vector.<DD><CODE>capacityIncr</CODE> - The size of the increment when vector grows.<DD><CODE>initValue</CODE> - The initial value stored in vector elements.</DL></DD></DL><HR><A NAME="Vector(structure.Vector)"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>(<A HREF="../structure/Vector.html">Vector</A>&nbsp;that)</PRE><DL></DL><HR><A NAME="Vector(java.util.Collection)"><!-- --></A><H3>Vector</H3><PRE>public <B>Vector</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html">Collection</A>&nbsp;c)</PRE><DL></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="ensureCapacity(int)"><!-- --></A><H3>ensureCapacity</H3><PRE>public void <B>ensureCapacity</B>(int&nbsp;minCapacity)</PRE><DL><DD>Ensure that the vector is capable of holding at least minCapacity values without expansion.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>minCapacity</CODE> - The minimum size of array before expansion.<DT><B>Postcondition:</B><DD>the capacity of this vector is at least minCapacity</DL></DD></DL><HR><A NAME="add(java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Add an element to the high end of the array, possibly expanding vector.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../structure/AbstractList.html#add(java.lang.Object)">add</A></CODE> in class <CODE><A HREF="../structure/AbstractList.html">AbstractList</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The object to be added to the end of the vector.<DT><B>Postcondition:</B><DD>adds new element to end of possibly extended vector</DL></DD></DL><HR><A NAME="addElement(java.lang.Object)"><!-- --></A><H3>addElement</H3><PRE>public void <B>addElement</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;o)</PRE><DL><DD>Add an element to the high end of the array, possibly expanding vector.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The object to be added to the end of the vector.<DT><B>Postcondition:</B><DD>adds new element to end of possibly extended vector</DL></DD></DL><HR><A NAME="remove(java.lang.Object)"><!-- --></A><H3>remove</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>remove</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;element)</PRE><DL><DD>Remove an element, by value, from vector.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>element</CODE> - the element to be removed.<DT><B>Postcondition:</B><DD>element equal to parameter is removed and returned<DT><B>Returns:</B><DD>the element actually removed, or if none, null.</DL></DD></DL><HR><A NAME="capacity()"><!-- --></A><H3>capacity</H3><PRE>public int <B>capacity</B>()</PRE><DL><DD>Determine the capacity of the vector.  The capacity is always at least as large as its size.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns allocated size of the vector<DT><B>Returns:</B><DD>The size of the array underlying the vector.</DL></DD></DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>clone</B>()</PRE><DL><DD>Construct a shallow copy of the vector.  The vector store is copied, but the individual elements are shared objects.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#clone()">clone</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns a copy of the vector, using same objects<DT><B>Returns:</B><DD>A copy of the original vector.</DL></DD></DL><HR><A NAME="contains(java.lang.Object)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;elem)</PRE><DL><DD>Determine if a value appears in a vector.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../structure/AbstractList.html#contains(java.lang.Object)">contains</A></CODE> in class <CODE><A HREF="../structure/AbstractList.html">AbstractList</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - The value sought.<DT><B>Postcondition:</B><DD>returns true iff Vector contains the value       (could be faster, if orderedVector is used)<DT><B>Returns:</B><DD>True iff the value appears in the vector.</DL></DD></DL><HR><A NAME="copyInto(java.lang.Object[])"><!-- --></A><H3>copyInto</H3><PRE>public void <B>copyInto</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>[]&nbsp;dest)</PRE><DL><DD>Copy the contents of the vector into an array. The array must be large enough to accept all the values in the vector.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>dest</CODE> - An array of size at least size().<DT><B>Precondition:</B><DD>dest has at least size() elements<DT><B>Postcondition:</B><DD>a copy of the vector is stored in the dest array</DL></DD></DL><HR><A NAME="elementAt(int)"><!-- --></A><H3>elementAt</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>elementAt</B>(int&nbsp;index)</PRE><DL><DD>Fetch the element at a particular index. The index of the first element is zero.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - The index of the value sought.<DT><B>Precondition:</B><DD>0 <= index && index < size()<DT><B>Postcondition:</B><DD>returns the element stored in location index<DT><B>Returns:</B><DD>A reference to the value found in the vector.</DL></DD></DL><HR><A NAME="get(int)"><!-- --></A><H3>get</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>get</B>(int&nbsp;index)</PRE><DL><DD>Fetch the element at a particular index. The index of the first element is zero.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - The index of the value sought.<DT><B>Precondition:</B><DD>0 <= index && index < size()<DT><B>Postcondition:</B><DD>returns the element stored in location index<DT><B>Returns:</B><DD>A reference to the value found in the vector.</DL></DD></DL><HR><A NAME="iterator()"><!-- --></A><H3>iterator</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html">Iterator</A> <B>iterator</B>()</PRE><DL><DD>Construct a iterator over the elements of the vector. The iterator considers elements with increasing index.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns an iterator allowing one to       view elements of vector<DT><B>Returns:</B><DD>an iterator to traverse the vector.</DL></DD></DL><HR><A NAME="firstElement()"><!-- --></A><H3>firstElement</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>firstElement</B>()</PRE><DL><DD>Get access to the first element of the vector.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>vector contains an element<DT><B>Postcondition:</B><DD>returns first value in vector<DT><B>Returns:</B><DD>Access to the first element of the vector.</DL></DD></DL><HR><A NAME="indexOf(java.lang.Object)"><!-- --></A><H3>indexOf</H3><PRE>public int <B>indexOf</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;elem)</PRE><DL><DD>Assuming the data is not in order, find the index of a value, or return -1 if not found.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - The value sought in vector.<DT><B>Postcondition:</B><DD>returns index of element equal to object, or -1; starts at 0<DT><B>Returns:</B><DD>The index of the first occurrence of the value.</DL></DD></DL><HR><A NAME="indexOf(java.lang.Object, int)"><!-- --></A><H3>indexOf</H3><PRE>public int <B>indexOf</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;elem,                   int&nbsp;index)</PRE><DL><DD>Assuming the data is not in order, find the index of a value or return -1 if the value is not found.  Search starts at index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>elem</CODE> - The value sought.<DD><CODE>index</CODE> - The first location considered.<DT><B>Postcondition:</B><DD>returns index of element equal to object, or -1; starts at index<DT><B>Returns:</B><DD>The index of the first location, or -1 if not found.</DL></DD></DL><HR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -