/** * @return A singleton {@link PersistentMap} associating the given key with the given value; * implemented as hash map. */ public static <K, V> PersistentMap<K, V> hashMap(K key, V val) { return Persistents.<K, V>hashMap().plus(key, val); }
/** @return A singleton {@link PersistentSet} with the value val; implemented as hash set. */ public static <E> PersistentSet<E> hashSet(E val) { return Persistents.<E>hashSet().plus(val); }
/** @return An singleton {@link PersistentList} with the value val; implemented as linked list. */ public static <E> PersistentList<E> linkedList(E val) { return Persistents.<E>linkedList().plus(val); }
/** @return A singleton {@link PersistentVector} with the value val. */ public static <E> PersistentVector<E> vector(E val) { return Persistents.<E>vector().plus(val); }
/** * @return A singleton {@link PersistentSortedMap} associating the given key with the given value; * implemented as tree map. */ public static <K, V> PersistentSortedMap<K, V> treeMap(K key, V val) { return Persistents.<K, V>treeMap().plus(key, val); }