mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
add java.util.Collection.toArray()
This commit is contained in:
@ -144,6 +144,10 @@ public class TreeMap<K,V> implements Map<K,V> {
|
||||
return set.removeAndReturn(new MyEntry(key, null)) != null;
|
||||
}
|
||||
|
||||
public Object[] toArray() {
|
||||
return toArray(new Object[size()]);
|
||||
}
|
||||
|
||||
public <T> T[] toArray(T[] array) {
|
||||
return Collections.toArray(this, array);
|
||||
}
|
||||
@ -182,6 +186,10 @@ public class TreeMap<K,V> implements Map<K,V> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Object[] toArray() {
|
||||
return toArray(new Object[size()]);
|
||||
}
|
||||
|
||||
public <T> T[] toArray(T[] array) {
|
||||
return Collections.toArray(this, array);
|
||||
}
|
||||
|
Reference in New Issue
Block a user