public class Vector<E> extends AbstractList<E> implements List<E>, RandomAccess
| Modifier and Type | Field and Description |
|---|---|
protected int |
capacityIncrement |
protected int |
elementCount |
protected Object[] |
elementData |
modCount| Constructor and Description |
|---|
Vector() |
Vector(Collection<? extends E> collection) |
Vector(int capacity) |
Vector(int capacity,
int capacityIncrement) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object) |
void |
add(int location,
E object) |
boolean |
addAll(Collection<? extends E> collection) |
boolean |
addAll(int location,
Collection<? extends E> collection) |
void |
addElement(E object) |
int |
capacity() |
void |
clear() |
boolean |
contains(Object object) |
boolean |
containsAll(Collection<?> collection) |
void |
copyInto(Object[] elements) |
E |
elementAt(int location) |
Enumeration<E> |
elements() |
void |
ensureCapacity(int minimumCapacity) |
boolean |
equals(Object object) |
E |
firstElement() |
E |
get(int location) |
int |
hashCode() |
int |
indexOf(Object object) |
int |
indexOf(Object object,
int location) |
void |
insertElementAt(E object,
int location) |
boolean |
isEmpty() |
E |
lastElement() |
int |
lastIndexOf(Object object) |
int |
lastIndexOf(Object object,
int location) |
E |
remove(int location) |
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> collection) |
void |
removeAllElements() |
boolean |
removeElement(Object object) |
void |
removeElementAt(int location) |
protected void |
removeRange(int start,
int end) |
boolean |
retainAll(Collection<?> collection) |
E |
set(int location,
E object) |
void |
setElementAt(E object,
int location) |
void |
setSize(int length) |
int |
size() |
List<E> |
subList(int start,
int end) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] contents) |
String |
toString() |
void |
trimToSize() |
iterator, listIterator, listIteratoriterator, listIterator, listIterator, replaceAll, sortremoveIfprotected int elementCount
protected Object[] elementData
protected int capacityIncrement
public Vector()
public Vector(int capacity)
public Vector(int capacity,
int capacityIncrement)
public Vector(Collection<? extends E> collection)
public void add(int location,
E object)
public boolean add(E object)
add in interface Collection<E>add in interface List<E>add in class AbstractList<E>public boolean addAll(int location,
Collection<? extends E> collection)
public boolean addAll(Collection<? extends E> collection)
addAll in interface Collection<E>addAll in interface List<E>addAll in class AbstractCollection<E>public void addElement(E object)
public int capacity()
public void clear()
clear in interface Collection<E>clear in interface List<E>clear in class AbstractList<E>public boolean contains(Object object)
contains in interface Collection<E>contains in interface List<E>contains in class AbstractCollection<E>public boolean containsAll(Collection<?> collection)
containsAll in interface Collection<E>containsAll in interface List<E>containsAll in class AbstractCollection<E>public void copyInto(Object[] elements)
public E elementAt(int location)
public Enumeration<E> elements()
public void ensureCapacity(int minimumCapacity)
public boolean equals(Object object)
equals in interface Collection<E>equals in interface List<E>equals in class AbstractList<E>public E firstElement()
public E get(int location)
public int hashCode()
hashCode in interface Collection<E>hashCode in interface List<E>hashCode in class AbstractList<E>public int indexOf(Object object)
public int indexOf(Object object, int location)
public void insertElementAt(E object, int location)
public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>isEmpty in class AbstractCollection<E>public E lastElement()
public int lastIndexOf(Object object)
lastIndexOf in interface List<E>lastIndexOf in class AbstractList<E>public int lastIndexOf(Object object, int location)
public E remove(int location)
public boolean remove(Object object)
remove in interface Collection<E>remove in interface List<E>remove in class AbstractCollection<E>public boolean removeAll(Collection<?> collection)
removeAll in interface Collection<E>removeAll in interface List<E>removeAll in class AbstractCollection<E>public void removeAllElements()
public boolean removeElement(Object object)
public void removeElementAt(int location)
protected void removeRange(int start,
int end)
removeRange in class AbstractList<E>public boolean retainAll(Collection<?> collection)
retainAll in interface Collection<E>retainAll in interface List<E>retainAll in class AbstractCollection<E>public void setElementAt(E object, int location)
public void setSize(int length)
public int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractList<E>public <T> T[] toArray(T[] contents)
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractList<E>public String toString()
toString in class AbstractCollection<E>public void trimToSize()
Copyright © 2026. All rights reserved.