mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
55 lines
979 B
Java
55 lines
979 B
Java
package java.util;
|
|
|
|
public class Vector<T> implements List<T> {
|
|
private final ArrayList<T> list;
|
|
|
|
public Vector(int capacity) {
|
|
list = new ArrayList(capacity);
|
|
}
|
|
|
|
public Vector() {
|
|
this(0);
|
|
}
|
|
|
|
public synchronized int size() {
|
|
return list.size();
|
|
}
|
|
|
|
public synchronized boolean add(T element) {
|
|
return list.add(element);
|
|
}
|
|
|
|
public void addElement(T element) {
|
|
add(element);
|
|
}
|
|
|
|
public synchronized T get(int index) {
|
|
return list.get(index);
|
|
}
|
|
|
|
public T elementAt(int index) {
|
|
return get(index);
|
|
}
|
|
|
|
public synchronized T remove(int index) {
|
|
return list.remove(index);
|
|
}
|
|
|
|
public synchronized boolean remove(T element) {
|
|
return list.remove(element);
|
|
}
|
|
|
|
public synchronized void clear() {
|
|
list.clear();
|
|
}
|
|
|
|
public Iterator<T> iterator() {
|
|
return new Collections.ArrayListIterator(this);
|
|
}
|
|
|
|
public Enumeration<T> elements() {
|
|
return new Collections.IteratorEnumeration(iterator());
|
|
}
|
|
|
|
}
|