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

📄 vector.html

📁 学习JAVA的很好的JAVA包和文档包
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<A NAME="insertElementAt(java.lang.Object, int)"><!-- --></A><H3>insertElementAt</H3><PRE>public void <B>insertElementAt</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj,                            int&nbsp;index)</PRE><DL><DD>Insert an element at a particular location. Vector is grown as needed<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The value to be inserted.<DD><CODE>index</CODE> - The location of the new value.<DT><B>Precondition:</B><DD>0 <= index <= size()<DT><B>Postcondition:</B><DD>inserts new value in vector with desired index,   moving elements from index to size()-1 to right</DL></DD></DL><HR><A NAME="add(int, java.lang.Object)"><!-- --></A><H3>add</H3><PRE>public void <B>add</B>(int&nbsp;index,                <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Insert an element at a particular location. Vector is grown as needed<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the value to be inserted.<DD><CODE>index</CODE> - the location of the new value.<DT><B>Precondition:</B><DD>0 <= index <= size()<DT><B>Postcondition:</B><DD>inserts new value in vector with desired index,   moving elements from index to size()-1 to right</DL></DD></DL><HR><A NAME="isEmpty()"><!-- --></A><H3>isEmpty</H3><PRE>public boolean <B>isEmpty</B>()</PRE><DL><DD>Determine if the Vector contains no values.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../structure/AbstractList.html#isEmpty()">isEmpty</A></CODE> in class <CODE><A HREF="../structure/AbstractList.html">AbstractList</A></CODE></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns true iff there are no elements in the vector<DT><B>Returns:</B><DD>True iff the vector is empty.</DL></DD></DL><HR><A NAME="lastElement()"><!-- --></A><H3>lastElement</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>lastElement</B>()</PRE><DL><DD>Fetch a reference to the last value in the vector.<DD><DL></DL></DD><DD><DL><DT><B>Precondition:</B><DD>vector is not empty<DT><B>Postcondition:</B><DD>returns last element of the vector<DT><B>Returns:</B><DD>A reference to the last value.</DL></DD></DL><HR><A NAME="lastIndexOf(java.lang.Object)"><!-- --></A><H3>lastIndexOf</H3><PRE>public int <B>lastIndexOf</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Search for the last occurrence of a value within the vector.  If none is found, return -1.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The value sought.<DT><B>Postcondition:</B><DD>returns index of last occurrence of object in the vector, or -1<DT><B>Returns:</B><DD>The index of the last occurrence in the vector.</DL></DD></DL><HR><A NAME="lastIndexOf(java.lang.Object, int)"><!-- --></A><H3>lastIndexOf</H3><PRE>public int <B>lastIndexOf</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj,                       int&nbsp;index)</PRE><DL><DD>Find the index of the last occurrence of the value in the vector before the indexth position.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The value sought.<DD><CODE>index</CODE> - The last acceptable index.<DT><B>Precondition:</B><DD>index >= 0<DT><B>Postcondition:</B><DD>returns the index of last occurrence of object at or before       index<DT><B>Returns:</B><DD>The index of the last occurrence of the value, or -1 if none.</DL></DD></DL><HR><A NAME="clear()"><!-- --></A><H3>clear</H3><PRE>public void <B>clear</B>()</PRE><DL><DD>Remove all the values of the vector.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>vector is empty</DL></DD></DL><HR><A NAME="removeAllElements()"><!-- --></A><H3>removeAllElements</H3><PRE>public void <B>removeAllElements</B>()</PRE><DL><DD>Remove all the elements of the vector. Kept for compatibility with java.util.Vector.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>vector is empty<DT><B>See Also: </B><DD><A HREF="../structure/Vector.html#clear()"><CODE>clear()</CODE></A></DL></DD></DL><HR><A NAME="removeElementAt(int)"><!-- --></A><H3>removeElementAt</H3><PRE>public void <B>removeElementAt</B>(int&nbsp;where)</PRE><DL><DD>Remove an element at a particular location.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>where</CODE> - The location of the element to be removed.<DT><B>Precondition:</B><DD>0 <= where && where < size()<DT><B>Postcondition:</B><DD>indicated element is removed, size decreases by 1</DL></DD></DL><HR><A NAME="remove(int)"><!-- --></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>(int&nbsp;where)</PRE><DL><DD>Remove an element at a particular location.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>where</CODE> - The location of the element to be removed.<DT><B>Precondition:</B><DD>0 <= where && where < size()<DT><B>Postcondition:</B><DD>indicated element is removed, size decreases by 1</DL></DD></DL><HR><A NAME="setElementAt(java.lang.Object, int)"><!-- --></A><H3>setElementAt</H3><PRE>public void <B>setElementAt</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj,                         int&nbsp;index)</PRE><DL><DD>Change the value stored at location index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The new value to be stored.<DD><CODE>index</CODE> - The index of the new value.<DT><B>Precondition:</B><DD>0 <= index && index < size()<DT><B>Postcondition:</B><DD>element value is changed to obj</DL></DD></DL><HR><A NAME="set(int, java.lang.Object)"><!-- --></A><H3>set</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> <B>set</B>(int&nbsp;index,                  <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Change the value stored at location index.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The new value to be stored.<DD><CODE>index</CODE> - The index of the new value.<DT><B>Precondition:</B><DD>0 <= index && index < size()<DT><B>Postcondition:</B><DD>element value is changed to obj; old value is returned</DL></DD></DL><HR><A NAME="setSize(int)"><!-- --></A><H3>setSize</H3><PRE>public void <B>setSize</B>(int&nbsp;newSize)</PRE><DL><DD>Explicitly set the size of the array. Any new elements are initialized to the default value.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newSize</CODE> - The ultimate size of the vector.<DT><B>Precondition:</B><DD>newSize >= 0<DT><B>Postcondition:</B><DD>vector is resized, any new elements are initialized</DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public int <B>size</B>()</PRE><DL><DD>Determine the number of elements in the vector.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>returns the size of the vector<DT><B>Returns:</B><DD>The number of elements within the vector.</DL></DD></DL><HR><A NAME="trimToSize()"><!-- --></A><H3>trimToSize</H3><PRE>public void <B>trimToSize</B>()</PRE><DL><DD>Trim the vector to exactly the correct size.<DD><DL></DL></DD><DD><DL><DT><B>Postcondition:</B><DD>minimizes allocated size of vector</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Determine a string representation for the vector.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()">toString</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 string representation of vector<DT><B>Returns:</B><DD>A string representation for the vector.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><a href=../copyright.html target=_top>&copy; 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../structure/ValueIterator.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../structure/VectorHeap.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Vector.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>

⌨️ 快捷键说明

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