?? vector.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Aug 23 13:18:20 EDT 2002 --><TITLE>: Class Vector</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><a href=../copyright.html target=_top>© 1998-2002 McGraw-Hill</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../structure/ValueIterator.html"><B>PREV CLASS</B></A> <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> <A HREF="Vector.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">structure</FONT><BR>Class Vector</H2><PRE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">java.lang.Object</A> | +--<A HREF="../structure/AbstractStructure.html">structure.AbstractStructure</A> | +--<A HREF="../structure/AbstractList.html">structure.AbstractList</A> | +--<B>structure.Vector</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Cloneable.html">Cloneable</A>, <A HREF="../structure/List.html">List</A>, <A HREF="../structure/Structure.html">Structure</A></DD></DL><HR><DL><DT>public class <B>Vector</B><DT>extends <A HREF="../structure/AbstractList.html">AbstractList</A><DT>implements <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Cloneable.html">Cloneable</A></DL><P>An implementation of extensible arrays, similar to that of <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Vector.html"><CODE>java.util.Vector</CODE></A>. This vector class implements a basic extensible array. It does not implement any of the additional features of the Sun class, including list-like operations. Those operations are available in other implementors of <A HREF="../structure/List.html"><CODE>List</CODE></A> in this package. <p> Example usage: To put a program's parameters into a Vector, we would use the following: <pre> public static void main(String[] arguments) { <A HREF="../structure/Vector.html"><CODE>Vector</CODE></A> argVec = new <A HREF="../structure/Vector.html#Vector()"><CODE>Vector()</CODE></A>; for (int i = 0; i < arguments.length; i++) { argVec.<A HREF="../structure/Vector.html#add(java.lang.Object)"><CODE>add(arguments[i])</CODE></A>; } System.out.println(<A HREF="../structure/Vector.html#toString()"><CODE>argVec</CODE></A>); } </pre><P><DL><DT><B>Since: </B><DD>JavaStructures 1.0</DD></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Vector.html#capacityIncrement">capacityIncrement</A></B></CODE><BR> The size of size increment, should the vector become full.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected static int</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Vector.html#defaultCapacity">defaultCapacity</A></B></CODE><BR> The default size of the vector; may be overridden in the <A HREF="../structure/Vector.html#Vector(int)"><CODE>Vector(int)</CODE></A> constructor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Vector.html#elementCount">elementCount</A></B></CODE><BR> The actual number of elements logically stored within the vector.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Vector.html#elementData">elementData</A></B></CODE><BR> The data associated with the vector.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Vector.html#initialValue">initialValue</A></B></CODE><BR> The initial value of any new elements that are appended to the vector.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/Vector.html#Vector()">Vector</A></B>()</CODE><BR> Construct an empty vector.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/Vector.html#Vector(java.util.Collection)">Vector</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html">Collection</A> c)</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/Vector.html#Vector(int)">Vector</A></B>(int initialCapacity)</CODE><BR> Construct an empty vector capable of storing <code>initialCapacity</code> values before the vector must be extended.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/Vector.html#Vector(int, int)">Vector</A></B>(int initialCapacity, int capacityIncr)</CODE><BR> Construct a vector with initial capacity, and growth characteristic.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/Vector.html#Vector(int, int, java.lang.Object)">Vector</A></B>(int initialCapacity, int capacityIncr, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> initValue)</CODE><BR> Construct a vector with initial size, growth rate and default value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../structure/Vector.html#Vector(structure.Vector)">Vector</A></B>(<A HREF="../structure/Vector.html">Vector</A> that)</CODE><BR> </TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></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="../structure/Vector.html#add(int, java.lang.Object)">add</A></B>(int index, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> obj)</CODE><BR> Insert an element at a particular location.</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="../structure/Vector.html#add(java.lang.Object)">add</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> obj)</CODE><BR> Add an element to the high end of the array, possibly expanding 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="../structure/Vector.html#addElement(java.lang.Object)">addElement</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> o)</CODE><BR> Add an element to the high end of the array, possibly expanding 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="../structure/Vector.html#capacity()">capacity</A></B>()</CODE><BR> Determine the capacity of the 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="../structure/Vector.html#clear()">clear</A></B>()</CODE><BR> Remove all the values of the vector.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../structure/Vector.html#clone()">clone</A></B>()</CODE><BR> Construct a shallow copy of the vector.</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="../structure/Vector.html#contains(java.lang.Object)">contains</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> elem)</CODE><BR> Determine if a value appears in a 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="../structure/Vector.html#copyInto(java.lang.Object[])">copyInto</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>[] dest)</CODE><BR> Copy the contents of the vector into an array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -