blob: 2843760b7f093c44fd41b202991c0d877624ece9 [file] [log] [blame]
Stuart McCullochd00f9712009-07-13 10:06:47 +00001package aQute.libg.generics;
2
3import java.util.*;
4
5public class Create {
6
7 public static <K,V> Map<K, V> map() {
8 return new LinkedHashMap<K,V>();
9 }
10
11 public static <T> List<T> list() {
12 return new ArrayList<T>();
13 }
14
15 public static <T> Set<T> set() {
16 return new HashSet<T>();
17 }
18
19 public static <T> List<T> list(T[] source) {
20 return new ArrayList<T>(Arrays.asList(source));
21 }
22
23 public static <T> Set<T> set(T[]source) {
24 return new HashSet<T>(Arrays.asList(source));
25 }
26
27 public static <K,V> Map<K, V> copy(Map<K,V> source) {
28 return new LinkedHashMap<K,V>(source);
29 }
30
31 public static <T> List<T> copy(List<T> source) {
32 return new ArrayList<T>(source);
33 }
34
35 public static <T> Set<T> copy(Set<T> source) {
36 return new HashSet<T>(source);
37 }
38
39
40}