Collection(컬렉션) 과 관련된 메서드를 제공
참고: 자바 컬렉션 (Java Collection, 컬렉션 프레임워크)
static Collection synchronizedCollection(Collection c)
static List synchronizedList(List list)
static Set synchronizedSet(Set s)
static Map synchronizedMap(Map m)
static SortedSet synchronizedSortedSet(SortedSet s)
static SortedMap synchronizedSortedMap(SortedMap m)
// 다음과 같이 사용할 수 있다
List syncList = Collections.synchronizedList(new ArrayList());
static Collection unmodifiableCollection(Collection c)
static List unmodifiableList(List list)
static Set unmodifiableSet(Set s)
static Map unmodifiableMap(Map m)
static NavigableSet unmodifiableNavigableSet(NavigableSet s)
static SortedSet unmodifiableSortedSet(SortedSet s)
static NavigableMap unmodifiableNavigableMap(NavigableMap m)
static SortedMap unmodifiableSortedMap(SortedMap m)
static List singletonList(Object o)
static Set singleton(Object o) //SingletonSet이 아님
static Map singletonMap(Object key, Object value)
static Collection checkedCollection(Collection c, Class type)
static List checkedList(List list, Class type)
static Set checkedSet(Set s, Class type)
static Map checkedMap(Map m, Class keyType, Class valueType)
static Queue checkedQueue(Queue queue, Class type)
static NavigableSet checkedNavigableSet(NavigableSet s, Class type)
static SortedSet checkedSortedSet(SortedSet s, Class type)
static NavigableMap checkedNavigableMap(NavigableMap m, Class keyType, Class valueType)
static SortedMap checkedSortedMap(SortedMap m, Class keyType, Class valueType)
// 다음과 같이 사용할 수 있다
List list = new ArrayList();
List checkedList = checkedList(list, String.class); // 두 번째 매개변수 : 저장할 객체의 클래스 지정 (여기서는 String만 저장 가능)
checkedList.add("abc");
checkedList.add(new Integer(3)); // 에러 : ClassCastException 발생