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

Method clear

lib/java/util/AbstractCollection.java:100–106  ·  view source on GitHub ↗

Removes all elements from this Collection, leaving it empty (optional). This implementation iterates over this Collection and calls the remove method on each element. If the iterator does not support removal of elements, an UnsupportedOperationException is thrown.

()

Source from the content-addressed store, hash-verified

98 * @see #size
99 */
100 public void clear() {
101 Iterator<E> it = iterator();
102 while (it.hasNext()) {
103 it.next();
104 it.remove();
105 }
106 }
107
108 /**
109 * Tests whether this {@code Collection} contains the specified object. This

Callers

nothing calls this directly

Calls 4

iteratorMethod · 0.95
hasNextMethod · 0.65
nextMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected