1 8 9 package com.sleepycat.collections; 10 11 import java.util.Collection ; 12 import java.util.Iterator ; 13 import java.util.List ; 14 import java.util.Map ; 15 import java.util.Set ; 16 import java.util.SortedMap ; 17 import java.util.SortedSet ; 18 19 import com.sleepycat.je.CursorConfig; 20 21 45 public class StoredCollections { 46 47 private StoredCollections() {} 48 49 63 public static Collection configuredCollection(Collection storedCollection, 64 CursorConfig config) { 65 66 return (Collection ) 67 ((StoredContainer) storedCollection).configuredClone(config); 68 } 69 70 87 public static List configuredList(List storedList, CursorConfig config) { 88 89 return (List ) ((StoredContainer) storedList).configuredClone(config); 90 } 91 92 106 public static Map configuredMap(Map storedMap, CursorConfig config) { 107 108 return (Map ) ((StoredContainer) storedMap).configuredClone(config); 109 } 110 111 125 public static Set configuredSet(Set storedSet, CursorConfig config) { 126 127 return (Set ) ((StoredContainer) storedSet).configuredClone(config); 128 } 129 130 144 public static SortedMap configuredSortedMap(SortedMap storedSortedMap, 145 CursorConfig config) { 146 147 return (SortedMap ) 148 ((StoredContainer) storedSortedMap).configuredClone(config); 149 } 150 151 165 public static SortedSet configuredSortedSet(SortedSet storedSortedSet, 166 CursorConfig config) { 167 168 return (SortedSet ) 169 ((StoredContainer) storedSortedSet).configuredClone(config); 170 } 171 172 178 public static Collection dirtyReadCollection(Collection storedCollection) { 179 180 181 return configuredCollection 182 (storedCollection, CursorConfig.DIRTY_READ); 183 } 184 185 190 public static List dirtyReadList(List storedList) { 191 192 193 return configuredList(storedList, CursorConfig.DIRTY_READ); 194 } 195 196 201 public static Map dirtyReadMap(Map storedMap) { 202 203 204 return configuredMap(storedMap, CursorConfig.DIRTY_READ); 205 } 206 207 212 public static Set dirtyReadSet(Set storedSet) { 213 214 215 return configuredSet(storedSet, CursorConfig.DIRTY_READ); 216 } 217 218 224 public static SortedMap dirtyReadSortedMap(SortedMap storedSortedMap) { 225 226 227 return configuredSortedMap 228 (storedSortedMap, CursorConfig.DIRTY_READ); 229 } 230 231 237 public static SortedSet dirtyReadSortedSet(SortedSet storedSortedSet) { 238 239 240 return configuredSortedSet 241 (storedSortedSet, CursorConfig.DIRTY_READ); 242 } 243 244 255 public static Iterator iterator(Iterator iter) { 256 257 return ((BaseIterator) iter).dup(); 258 } 259 } 260 | Popular Tags |