MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / copy

Method copy

Ports/CLDC11/src/java/util/Collections.java:1528–1545  ·  view source on GitHub ↗
(List<? super T> destination,
            List<? extends T> source)

Source from the content-addressed store, hash-verified

1526 /// when replacing an element in the destination list is not
1527 /// supported.
1528 public static <T> void copy(List<? super T> destination,
1529 List<? extends T> source) {
1530 if (destination.size() < source.size()) {
1531 // luni.38=Source size {0} does not fit into destination
1532 throw new IndexOutOfBoundsException("" + source.size() + " out of: " + destination.size());
1533 }
1534 Iterator<? extends T> srcIt = source.iterator();
1535 ListIterator<? super T> destIt = destination.listIterator();
1536 while (srcIt.hasNext()) {
1537 try {
1538 destIt.next();
1539 } catch (NoSuchElementException e) {
1540 // luni.38=Source size {0} does not fit into destination
1541 throw new IndexOutOfBoundsException("" + source.size());
1542 }
1543 destIt.set(srcIt.next());
1544 }
1545 }
1546
1547 /// Returns an `Enumeration` on the specified collection.
1548 ///

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.65
iteratorMethod · 0.65
listIteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected