Vector (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
boolean
[add](../../java/util/Vector.html#add-E-)([E](../../java/util/Vector.html "type parameter in Vector") e)
Appends the specified element to the end of this Vector.
void
[add](../../java/util/Vector.html#add-int-E-)(int index,[E](../../java/util/Vector.html "type parameter in Vector") element)
Inserts the specified element at the specified position in this Vector.
boolean
[addAll](../../java/util/Vector.html#addAll-java.util.Collection-)([Collection](../../java/util/Collection.html "interface in java.util")<? extends [E](../../java/util/Vector.html "type parameter in Vector")> 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.
boolean
[addAll](../../java/util/Vector.html#addAll-int-java.util.Collection-)(int index,[Collection](../../java/util/Collection.html "interface in java.util")<? extends [E](../../java/util/Vector.html "type parameter in Vector")> c)
Inserts all of the elements in the specified Collection into this Vector at the specified position.
void
[addElement](../../java/util/Vector.html#addElement-E-)([E](../../java/util/Vector.html "type parameter in Vector") obj)
Adds the specified component to the end of this vector, increasing its size by one.
int
[capacity](../../java/util/Vector.html#capacity--)()
Returns the current capacity of this vector.
void
[clear](../../java/util/Vector.html#clear--)()
Removes all of the elements from this Vector.
[Object](../../java/lang/Object.html "class in java.lang")
[clone](../../java/util/Vector.html#clone--)()
Returns a clone of this vector.
boolean
[contains](../../java/util/Vector.html#contains-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") o)
Returns true
if this vector contains the specified element.
boolean
[containsAll](../../java/util/Vector.html#containsAll-java.util.Collection-)([Collection](../../java/util/Collection.html "interface in java.util")<?> c)
Returns true if this Vector contains all of the elements in the specified Collection.
void
[copyInto](../../java/util/Vector.html#copyInto-java.lang.Object:A-)([Object](../../java/lang/Object.html "class in java.lang")[] anArray)
Copies the components of this vector into the specified array.
[E](../../java/util/Vector.html "type parameter in Vector")
[elementAt](../../java/util/Vector.html#elementAt-int-)(int index)
Returns the component at the specified index.
[Enumeration](../../java/util/Enumeration.html "interface in java.util")<[E](../../java/util/Vector.html "type parameter in Vector")>
[elements](../../java/util/Vector.html#elements--)()
Returns an enumeration of the components of this vector.
void
[ensureCapacity](../../java/util/Vector.html#ensureCapacity-int-)(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.
boolean
[equals](../../java/util/Vector.html#equals-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") o)
Compares the specified Object with this Vector for equality.
[E](../../java/util/Vector.html "type parameter in Vector")
[firstElement](../../java/util/Vector.html#firstElement--)()
Returns the first component (the item at index 0
) of this vector.
void
[forEach](../../java/util/Vector.html#forEach-java.util.function.Consumer-)([Consumer](../../java/util/function/Consumer.html "interface in java.util.function")<? super [E](../../java/util/Vector.html "type parameter in Vector")> action)
Performs the given action for each element of the Iterable
until all elements have been processed or the action throws an exception.
[E](../../java/util/Vector.html "type parameter in Vector")
[get](../../java/util/Vector.html#get-int-)(int index)
Returns the element at the specified position in this Vector.
int
[hashCode](../../java/util/Vector.html#hashCode--)()
Returns the hash code value for this Vector.
int
[indexOf](../../java/util/Vector.html#indexOf-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") 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.
int
[indexOf](../../java/util/Vector.html#indexOf-java.lang.Object-int-)([Object](../../java/lang/Object.html "class in java.lang") 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.
void
[insertElementAt](../../java/util/Vector.html#insertElementAt-E-int-)([E](../../java/util/Vector.html "type parameter in Vector") obj, int index)
Inserts the specified object as a component in this vector at the specified index
.
boolean
[isEmpty](../../java/util/Vector.html#isEmpty--)()
Tests if this vector has no components.
[Iterator](../../java/util/Iterator.html "interface in java.util")<[E](../../java/util/Vector.html "type parameter in Vector")>
[iterator](../../java/util/Vector.html#iterator--)()
Returns an iterator over the elements in this list in proper sequence.
[E](../../java/util/Vector.html "type parameter in Vector")
[lastElement](../../java/util/Vector.html#lastElement--)()
Returns the last component of the vector.
int
[lastIndexOf](../../java/util/Vector.html#lastIndexOf-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") 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.
int
[lastIndexOf](../../java/util/Vector.html#lastIndexOf-java.lang.Object-int-)([Object](../../java/lang/Object.html "class in java.lang") 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.
[ListIterator](../../java/util/ListIterator.html "interface in java.util")<[E](../../java/util/Vector.html "type parameter in Vector")>
[listIterator](../../java/util/Vector.html#listIterator--)()
Returns a list iterator over the elements in this list (in proper sequence).
[ListIterator](../../java/util/ListIterator.html "interface in java.util")<[E](../../java/util/Vector.html "type parameter in Vector")>
[listIterator](../../java/util/Vector.html#listIterator-int-)(int index)
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.
[E](../../java/util/Vector.html "type parameter in Vector")
[remove](../../java/util/Vector.html#remove-int-)(int index)
Removes the element at the specified position in this Vector.
boolean
[remove](../../java/util/Vector.html#remove-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") o)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged.
boolean
[removeAll](../../java/util/Vector.html#removeAll-java.util.Collection-)([Collection](../../java/util/Collection.html "interface in java.util")<?> c)
Removes from this Vector all of its elements that are contained in the specified Collection.
void
[removeAllElements](../../java/util/Vector.html#removeAllElements--)()
Removes all components from this vector and sets its size to zero.
boolean
[removeElement](../../java/util/Vector.html#removeElement-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") obj)
Removes the first (lowest-indexed) occurrence of the argument from this vector.
void
[removeElementAt](../../java/util/Vector.html#removeElementAt-int-)(int index)
Deletes the component at the specified index.
boolean
[removeIf](../../java/util/Vector.html#removeIf-java.util.function.Predicate-)([Predicate](../../java/util/function/Predicate.html "interface in java.util.function")<? super [E](../../java/util/Vector.html "type parameter in Vector")> filter)
Removes all of the elements of this collection that satisfy the given predicate.
protected void
[removeRange](../../java/util/Vector.html#removeRange-int-int-)(int fromIndex, int toIndex)
Removes from this list all of the elements whose index is betweenfromIndex
, inclusive, and toIndex
, exclusive.
void
[replaceAll](../../java/util/Vector.html#replaceAll-java.util.function.UnaryOperator-)([UnaryOperator](../../java/util/function/UnaryOperator.html "interface in java.util.function")<[E](../../java/util/Vector.html "type parameter in Vector")> operator)
Replaces each element of this list with the result of applying the operator to that element.
boolean
[retainAll](../../java/util/Vector.html#retainAll-java.util.Collection-)([Collection](../../java/util/Collection.html "interface in java.util")<?> c)
Retains only the elements in this Vector that are contained in the specified Collection.
[E](../../java/util/Vector.html "type parameter in Vector")
[set](../../java/util/Vector.html#set-int-E-)(int index,[E](../../java/util/Vector.html "type parameter in Vector") element)
Replaces the element at the specified position in this Vector with the specified element.
void
[setElementAt](../../java/util/Vector.html#setElementAt-E-int-)([E](../../java/util/Vector.html "type parameter in Vector") obj, int index)
Sets the component at the specified index
of this vector to be the specified object.
void
[setSize](../../java/util/Vector.html#setSize-int-)(int newSize)
Sets the size of this vector.
int
[size](../../java/util/Vector.html#size--)()
Returns the number of components in this vector.
void
[sort](../../java/util/Vector.html#sort-java.util.Comparator-)([Comparator](../../java/util/Comparator.html "interface in java.util")<? super [E](../../java/util/Vector.html "type parameter in Vector")> c)
Sorts this list according to the order induced by the specifiedComparator.
[Spliterator](../../java/util/Spliterator.html "interface in java.util")<[E](../../java/util/Vector.html "type parameter in Vector")>
[spliterator](../../java/util/Vector.html#spliterator--)()
[List](../../java/util/List.html "interface in java.util")<[E](../../java/util/Vector.html "type parameter in Vector")>
[subList](../../java/util/Vector.html#subList-int-int-)(int fromIndex, int toIndex)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive.
[Object](../../java/lang/Object.html "class in java.lang")[]
[toArray](../../java/util/Vector.html#toArray--)()
Returns an array containing all of the elements in this Vector in the correct order.
<T> T[]
[toArray](../../java/util/Vector.html#toArray-T:A-)(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.
[String](../../java/lang/String.html "class in java.lang")
[toString](../../java/util/Vector.html#toString--)()
Returns a string representation of this Vector, containing the String representation of each element.
void
[trimToSize](../../java/util/Vector.html#trimToSize--)()
Trims the capacity of this vector to be the vector's current size.