Boolean |
add(element: E)
Appends the specified element to the end of this Vector.
|
Unit |
add(index: Int, element: E)
Inserts the specified element at the specified position in this Vector. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
|
Boolean |
addAll(elements: Collection<E>)
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. The behavior of this operation is undefined if the specified Collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this Vector, and this Vector is nonempty.)
|
Boolean |
addAll(index: Int, elements: Collection<E>)
Inserts all of the elements in the specified Collection into this Vector at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the Vector in the order that they are returned by the specified Collection's iterator.
|
Unit |
addElement(obj: E)
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.
This method is identical in functionality to the #add(java.lang.Object) method (which is part of the List interface).
|
Int |
capacity()
Returns the current capacity of this vector.
|
Unit |
clear()
Removes all of the elements from this Vector. The Vector will be empty after this call returns (unless it throws an exception).
|
Any |
clone()
Returns a clone of this vector. The copy will contain a reference to a clone of the internal data array, not a reference to the original internal data array of this Vector object.
|
Boolean |
contains(element: E?)
Returns true if this vector contains the specified element. More formally, returns true if and only if this vector contains at least one element e such that Objects.equals(o, e) .
|
Boolean |
containsAll(elements: Collection<E>)
Returns true if this Vector contains all of the elements in the specified Collection.
|
Unit |
copyInto(anArray: Array<Any!>)
Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray .
|
E |
elementAt(index: Int)
Returns the component at the specified index.
This method is identical in functionality to the get(int) method (which is part of the List interface).
|
Enumeration<E> |
elements()
Returns an enumeration of the components of this vector. The returned Enumeration object will generate all items in this vector. The first item generated is the item at index 0 , then the item at index 1 , and so on. If the vector is structurally modified while enumerating over the elements then the results of enumerating are undefined.
|
Unit |
ensureCapacity(minCapacity: Int)
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.
If the current capacity of this vector is less than minCapacity , then its capacity is increased by replacing its internal data array, kept in the field elementData , with a larger one. The size of the new data array will be the old size plus capacityIncrement , unless the value of capacityIncrement is less than or equal to zero, in which case the new capacity will be twice the old capacity; but if this new size is still smaller than minCapacity , then the new capacity will be minCapacity .
|
Boolean |
equals(other: Any?)
Compares the specified Object with this Vector for equality. Returns true if and only if the specified Object is also a List, both Lists have the same size, and all corresponding pairs of elements in the two Lists are equal. (Two elements e1 and e2 are equal if Objects.equals(e1, e2) .) In other words, two Lists are defined to be equal if they contain the same elements in the same order.
|
E |
firstElement()
Returns the first component (the item at index 0 ) of this vector.
|
Unit |
forEach(action: Consumer<in E>)
|
E |
get(index: Int)
Returns the element at the specified position in this Vector.
|
Int |
hashCode()
Returns the hash code value for this Vector.
|
Int |
indexOf(o: Any?, index: Int)
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. More formally, returns the lowest index i such that (i >= index && Objects.equals(o, get(i))) , or -1 if there is no such index.
|
Int |
indexOf(element: E?)
Returns the index of the first occurrence of the specified element in this vector, or -1 if this vector does not contain the element. More formally, returns the lowest index i such that Objects.equals(o, get(i)) , or -1 if there is no such index.
|
Unit |
insertElementAt(obj: E, index: Int)
Inserts the specified object as a component in this vector at the specified index . Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.
The index must be a value greater than or equal to 0 and less than or equal to the current size of the vector. (If the index is equal to the current size of the vector, the new element is appended to the Vector.)
This method is identical in functionality to the add(int, E) method (which is part of the List interface). Note that the add method reverses the order of the parameters, to more closely match array usage.
|
Boolean |
isEmpty()
Tests if this vector has no components.
|
MutableIterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
The returned iterator is fail-fast.
|
E |
lastElement()
Returns the last component of the vector.
|
Int |
lastIndexOf(o: Any?, index: Int)
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. More formally, returns the highest index i such that (i <= index && Objects.equals(o, get(i))) , or -1 if there is no such index.
|
Int |
lastIndexOf(element: E?)
Returns the index of the last occurrence of the specified element in this vector, or -1 if this vector does not contain the element. More formally, returns the highest index i such that Objects.equals(o, get(i)) , or -1 if there is no such index.
|
MutableListIterator<E> |
listIterator(index: Int)
Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. The specified index indicates the first element that would be returned by an initial call to next . An initial call to previous would return the element with the specified index minus one.
The returned list iterator is fail-fast.
|
MutableListIterator<E> |
listIterator()
Returns a list iterator over the elements in this list (in proper sequence).
The returned list iterator is fail-fast.
|
Boolean |
remove(element: E?)
Removes the first occurrence of the specified element in this Vector If the Vector does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that Objects.equals(o, get(i)) (if such an element exists).
|
Boolean |
removeAll(elements: Collection<E>)
Removes from this Vector all of its elements that are contained in the specified Collection.
|
Unit |
removeAllElements()
Removes all components from this vector and sets its size to zero.
This method is identical in functionality to the #clear method (which is part of the List interface).
|
E |
removeAt(index: Int)
Removes the element at the specified position in this Vector. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the Vector.
|
Boolean |
removeElement(obj: Any?)
Removes the first (lowest-indexed) occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.
This method is identical in functionality to the #remove(java.lang.Object) method (which is part of the List interface).
|
Unit |
removeElementAt(index: Int)
Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this vector is decreased by 1 .
The index must be a value greater than or equal to 0 and less than the current size of the vector.
This method is identical in functionality to the remove(int) method (which is part of the List interface). Note that the remove method returns the old value that was stored at the specified position.
|
Boolean |
removeIf(filter: Predicate<in E>)
|
Unit |
removeRange(fromIndex: Int, toIndex: Int)
Removes from this list all of the elements whose index is between fromIndex , inclusive, and toIndex , exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by (toIndex - fromIndex) elements. (If toIndex==fromIndex , this operation has no effect.)
|
Unit |
replaceAll(operator: UnaryOperator<E>)
|
Boolean |
retainAll(elements: Collection<E>)
Retains only the elements in this Vector that are contained in the specified Collection. In other words, removes from this Vector all of its elements that are not contained in the specified Collection.
|
E |
set(index: Int, element: E)
Replaces the element at the specified position in this Vector with the specified element.
|
Unit |
setElementAt(obj: E, index: Int)
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded.
The index must be a value greater than or equal to 0 and less than the current size of the vector.
This method is identical in functionality to the set(int, E) method (which is part of the List interface). Note that the set method reverses the order of the parameters, to more closely match array usage. Note also that the set method returns the old value that was stored at the specified position.
|
Unit |
setSize(newSize: Int)
Sets the size of this vector. If the new size is greater than the current size, new null items are added to the end of the vector. If the new size is less than the current size, all components at index newSize and greater are discarded.
|
Unit |
sort(c: Comparator<in E>?)
|
Spliterator<E> |
spliterator()
Creates a late-binding and fail-fast Spliterator over the elements in this list.
The Spliterator reports Spliterator#SIZED , Spliterator#SUBSIZED , and Spliterator#ORDERED . Overriding implementations should document the reporting of additional characteristic values.
|
MutableList<E> |
subList(fromIndex: Int, toIndex: Int)
Returns a view of the portion of this List between fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned List is empty.) The returned List is backed by this List, so changes in the returned List are reflected in this List, and vice-versa. The returned List supports all of the optional List operations supported by this List.
This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a List can be used as a range operation by operating on a subList view instead of a whole List. For example, the following idiom removes a range of elements from a List:
list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.
The semantics of the List returned by this method become undefined if the backing list (i.e., this List) is structurally modified in any way other than via the returned List. (Structural modifications are those that change the size of the List, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)
|
Array<Any!> |
toArray()
Returns an array containing all of the elements in this Vector in the correct order.
|
Array<T> |
toArray(a: Array<T>)
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. If the Vector fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this Vector.
If the Vector fits in the specified array with room to spare (i.e., the array has more elements than the Vector), the element in the array immediately following the end of the Vector is set to null. (This is useful in determining the length of the Vector only if the caller knows that the Vector does not contain any null elements.)
|
String |
toString()
Returns a string representation of this Vector, containing the String representation of each element.
|
Unit |
trimToSize()
Trims the capacity of this vector to be the vector's current size. If the capacity of this vector is larger than its current size, then the capacity is changed to equal the size by replacing its internal data array, kept in the field elementData , with a smaller one. An application can use this operation to minimize the storage of a vector.
|