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

Method checkedList

lib/java/util/Collections.java:2558–2563  ·  view source on GitHub ↗

Returns a dynamically typesafe view of the specified list. Trying to insert an element of the wrong type into this list throws a ClassCastException. At creation time the types in list are not checked for correct type. @param list the list to be wrapped in a typesafe list.

(List<E> list, Class<E> type)

Source from the content-addressed store, hash-verified

2556 * @return a typesafe list.
2557 */
2558 public static <E> List<E> checkedList(List<E> list, Class<E> type) {
2559 if (list instanceof RandomAccess) {
2560 return new CheckedRandomAccessList<E>(list, type);
2561 }
2562 return new CheckedList<E>(list, type);
2563 }
2564
2565 /**
2566 * Returns a dynamically typesafe view of the specified set. Trying to

Callers 1

subListMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected