mirror of
https://github.com/corda/corda.git
synced 2025-06-14 21:28:14 +00:00
Make Vector a Cloneable
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
package java.util;
|
package java.util;
|
||||||
|
|
||||||
public class Vector<T> extends AbstractList<T> implements java.io.Serializable {
|
public class Vector<T> extends AbstractList<T> implements java.io.Serializable, Cloneable {
|
||||||
private final ArrayList<T> list;
|
private final ArrayList<T> list;
|
||||||
|
|
||||||
public Vector(int capacity) {
|
public Vector(int capacity) {
|
||||||
@ -127,4 +127,11 @@ public class Vector<T> extends AbstractList<T> implements java.io.Serializable {
|
|||||||
return new Collections.IteratorEnumeration(iterator());
|
return new Collections.IteratorEnumeration(iterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized Object clone() {
|
||||||
|
Vector copy = new Vector(size());
|
||||||
|
for (T t : this) {
|
||||||
|
copy.add(t);
|
||||||
|
}
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user