Java java.util Vector fields, constructors, methods, implement or subclass

Example usage for Java java.util Vector fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util Vector.

The text is from its open source code.

Subclass

java.util.Vector has subclasses.
Click this link to see all its subclasses.

Implementation

java.util.Vector has the following implementations.
Click this link to see all its implementation.

Constructor

Vector()
Constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero.
Vector(int initialCapacity)
Constructs an empty vector with the specified initial capacity and with its capacity increment equal to zero.
Vector(Collection c)
Constructs a vector containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Vector(int initialCapacity, int capacityIncrement)
Constructs an empty vector with the specified initial capacity and capacity increment.

Method

booleanadd(E e)
Appends the specified element to the end of this Vector.
voidadd(int index, E element)
Inserts the specified element at the specified position in this Vector.
booleanaddAll(Collection c)
Appends all of the elements in the specified Collection to the end of this Vector, in the order that they are returned by the specified Collection's Iterator.
booleanaddAll(int index, Collection c)
Inserts all of the elements in the specified Collection into this Vector at the specified position.
voidaddElement(E obj)
Adds the specified component to the end of this vector, increasing its size by one.
intcapacity()
Returns the current capacity of this vector.
voidclear()
Removes all of the elements from this Vector.
Objectclone()
Returns a clone of this vector.
booleancontains(Object o)
Returns true if this vector contains the specified element.
booleancontainsAll(Collection c)
Returns true if this Vector contains all of the elements in the specified Collection.
voidcopyInto(Object[] anArray)
Copies the components of this vector into the specified array.
EelementAt(int index)
Returns the component at the specified index.
Enumerationelements()
Returns an enumeration of the components of this vector.
voidensureCapacity(int minCapacity)
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.
booleanequals(Object o)
Compares the specified Object with this Vector for equality.
EfirstElement()
Returns the first component (the item at index 0 ) of this vector.
voidforEach(Consumer action)
Eget(int index)
Returns the element at the specified position in this Vector.
ClassgetClass()
Returns the runtime class of this Object .
inthashCode()
Returns the hash code value for this Vector.
intindexOf(Object o)
Returns the index of the first occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
intindexOf(Object o, int index)
Returns the index of the first occurrence of the specified element in this vector, searching forwards from index , or returns -1 if the element is not found.
voidinsertElementAt(E obj, int index)
Inserts the specified object as a component in this vector at the specified index .
booleanisEmpty()
Tests if this vector has no components.
Iteratoriterator()
Returns an iterator over the elements in this list in proper sequence.
ElastElement()
Returns the last component of the vector.
intlastIndexOf(Object o)
Returns the index of the last occurrence of the specified element in this vector, or -1 if this vector does not contain the element.
intlastIndexOf(Object o, int index)
Returns the index of the last occurrence of the specified element in this vector, searching backwards from index , or returns -1 if the element is not found.
ListIteratorlistIterator()
Returns a list iterator over the elements in this list (in proper sequence).
ListIteratorlistIterator(int index)
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
booleanremove(Object o)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged.
Eremove(int index)
Removes the element at the specified position in this Vector.
booleanremoveAll(Collection c)
Removes from this Vector all of its elements that are contained in the specified Collection.
voidremoveAllElements()
Removes all components from this vector and sets its size to zero.
booleanremoveElement(Object obj)
Removes the first (lowest-indexed) occurrence of the argument from this vector.
voidremoveElementAt(int index)
Deletes the component at the specified index.
booleanretainAll(Collection c)
Retains only the elements in this Vector that are contained in the specified Collection.
Eset(int index, E element)
Replaces the element at the specified position in this Vector with the specified element.
voidsetElementAt(E obj, int index)
Sets the component at the specified index of this vector to be the specified object.
voidsetSize(int newSize)
Sets the size of this vector.
intsize()
Returns the number of components in this vector.
Streamstream()
Returns a sequential Stream with this collection as its source.
ListsubList(int fromIndex, int toIndex)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
Object[]toArray()
Returns an array containing all of the elements in this Vector in the correct order.
T[]toArray(T[] a)
Returns an array containing all of the elements in this Vector in the correct order; the runtime type of the returned array is that of the specified array.
StringtoString()
Returns a string representation of this Vector, containing the String representation of each element.
voidtrimToSize()
Trims the capacity of this vector to be the vector's current size.