Mega Code Archive

 
Categories / Java Book / 005 Collection
 

0328 Check collections

static<E> Collection<E> checkedCollection(Collection<E> c, Class<E> type) Returns a dynamically typesafe view of the specified collection. static<E> List<E> checkedList(List<E> list, Class<E> type) Returns a dynamically typesafe view of the specified list. static<K,V> Map<K,V> checkedMap(Map<K,V> m, Class<K> keyType, Class<V> valueType) Returns a dynamically typesafe view of the specified map. static<E> Set<E> checkedSet(Set<E> s, Class<E> type) Returns a dynamically typesafe view of the specified set. static<K,V> SortedMap<K,V> checkedSortedMap(SortedMap<K,V> m, Class<K> keyType, Class<V> valueType) Returns a dynamically typesafe view of the specified sorted map. static<E> SortedSet<E> checkedSortedSet(SortedSet<E> s, Class<E> type) Returns a dynamically typesafe view of the specified sorted set.