MCPcopy Create free account
hub / github.com/davidgiven/luje / clone

Method clone

lib/java/util/LinkedList.java:390–404  ·  view source on GitHub ↗

Returns a new LinkedList with the same elements and size as this LinkedList. @return a shallow copy of this LinkedList. @see java.lang.Cloneable

()

Source from the content-addressed store, hash-verified

388 * @see java.lang.Cloneable
389 */
390 @SuppressWarnings("unchecked")
391 @Override
392 public Object clone() {
393 try {
394 LinkedList<E> l = (LinkedList<E>) super.clone();
395 l.size = 0;
396 l.voidLink = new Link<E>(null, null, null);
397 l.voidLink.previous = l.voidLink;
398 l.voidLink.next = l.voidLink;
399 l.addAll(this);
400 return l;
401 } catch (CloneNotSupportedException e) {
402 return null;
403 }
404 }
405
406 /**
407 * Searches this {@code LinkedList} for the specified object.

Callers

nothing calls this directly

Calls 1

addAllMethod · 0.65

Tested by

no test coverage detected