Java Reference
In-Depth Information
public static <E> Collection<E>
checkedCollection(Collection<E>
coll, Class<E> type)
Returns a dynamically typeset view of the given collection.
Any attempt to insert an element that is not of the specified
type will result in a
ClassCastException
.
The other type checked wrappers are obtained from
checkedList
,
checkedSet
,
checkedSortedSet
,
checkedMap
, and
checkedSortedMap
.