java.util.Vector (JDK 1.0)
This class implements an array of objects that grows in size as necessary. It is useful when you need to keep track of a number of objects but do not know in advance how many there will be. There are a number of methods for storing objects in and removing objects from the Vector. Other methods look up the object at specified positions in the Vector, or search for specified objects within the Vector. elements() returns an Enumeration of the objects stored in the Vector. size() returns the number of objects currently stored in the Vector. capacity() returns the number of elements that may be stored before the vector's internal storage must be reallocated.
public classVectorextends Object implements Cloneable, Serializable { //Public ConstructorspublicVector(intinitialCapacity, intcapacityIncrement); publicVector(intinitialCapacity); publicVector(); //Protected Instance Variablesprotected intcapacityIncrement; protected intelementCount; protected Object[]elementData; //Public Instance Methodspublic final synchronized voidaddElement(Objectobj); public final intcapacity(); public synchronized Objectclone(); //Overrides Objectpublic final booleancontains(Objectelem); public final synchronized voidcopyInto(Object[]anArray); public final synchronized ObjectelementAt(intindex); public final synchronized Enumerationelements(); public final synchronized voidensureCapacity(intminCapacity); public final synchronized ObjectfirstElement(); public final intindexOf(Objectelem); public final synchronized intindexOf(Objectelem, intindex); public final synchronized voidinsertElementAt(Objectobj, intindex); public final booleanisEmpty(); public final synchronized ObjectlastElement(); public final intlastIndexOf(Objectelem); public final synchronized intlastIndexOf(Objectelem, intindex); public final synchronized voidremoveAllElements(); public final synchronized booleanremoveElement(Objectobj); public final synchronized voidremoveElementAt(intindex); public final synchronized voidsetElementAt(Objectobj, intindex); public final synchronized voidsetSize(intnewSize); public final intsize(); public final synchronized StringtoString(); //Overrides Objectpublic final synchronized voidtrimToSize(); }
Extended By:
Stack