Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

StoredCollections.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2000-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: StoredCollections.java,v 12.1 2005/01/31 19:27:32 mark Exp $
00008  */
00009 
00010 package com.sleepycat.collections;
00011 
00012 import java.util.Collection;
00013 import java.util.Iterator;
00014 import java.util.List;
00015 import java.util.Map;
00016 import java.util.Set;
00017 import java.util.SortedMap;
00018 import java.util.SortedSet;
00019 
00020 import com.sleepycat.db.CursorConfig;
00021 
00044 public class StoredCollections {
00045 
00046     private StoredCollections() {}
00047 
00062     public static Collection configuredCollection(Collection storedCollection,
00063                                                   CursorConfig config) {
00064 
00065         return (Collection)
00066             ((StoredContainer) storedCollection).configuredClone(config);
00067     }
00068 
00086     public static List configuredList(List storedList, CursorConfig config) {
00087 
00088         return (List) ((StoredContainer) storedList).configuredClone(config);
00089     }
00090 
00105     public static Map configuredMap(Map storedMap, CursorConfig config) {
00106 
00107         return (Map) ((StoredContainer) storedMap).configuredClone(config);
00108     }
00109 
00124     public static Set configuredSet(Set storedSet, CursorConfig config) {
00125 
00126         return (Set) ((StoredContainer) storedSet).configuredClone(config);
00127     }
00128 
00143     public static SortedMap configuredSortedMap(SortedMap storedSortedMap,
00144                                                 CursorConfig config) {
00145 
00146         return (SortedMap)
00147             ((StoredContainer) storedSortedMap).configuredClone(config);
00148     }
00149 
00164     public static SortedSet configuredSortedSet(SortedSet storedSortedSet,
00165                                                 CursorConfig config) {
00166 
00167         return (SortedSet)
00168             ((StoredContainer) storedSortedSet).configuredClone(config);
00169     }
00170 
00177     public static Collection dirtyReadCollection(Collection storedCollection) {
00178 
00179         /* We can't use READ_UNCOMMITTED until is is added to DB core. */
00180         return configuredCollection
00181             (storedCollection, CursorConfig.DIRTY_READ);
00182     }
00183 
00189     public static List dirtyReadList(List storedList) {
00190 
00191         /* We can't use READ_UNCOMMITTED until is is added to DB core. */
00192         return configuredList(storedList, CursorConfig.DIRTY_READ);
00193     }
00194 
00200     public static Map dirtyReadMap(Map storedMap) {
00201 
00202         /* We can't use READ_UNCOMMITTED until is is added to DB core. */
00203         return configuredMap(storedMap, CursorConfig.DIRTY_READ);
00204     }
00205 
00211     public static Set dirtyReadSet(Set storedSet) {
00212 
00213         /* We can't use READ_UNCOMMITTED until is is added to DB core. */
00214         return configuredSet(storedSet, CursorConfig.DIRTY_READ);
00215     }
00216 
00223     public static SortedMap dirtyReadSortedMap(SortedMap storedSortedMap) {
00224 
00225         /* We can't use READ_UNCOMMITTED until is is added to DB core. */
00226         return configuredSortedMap
00227             (storedSortedMap, CursorConfig.DIRTY_READ);
00228     }
00229 
00236     public static SortedSet dirtyReadSortedSet(SortedSet storedSortedSet) {
00237 
00238         /* We can't use READ_UNCOMMITTED until is is added to DB core. */
00239         return configuredSortedSet
00240             (storedSortedSet, CursorConfig.DIRTY_READ);
00241     }
00242 
00254     public static Iterator iterator(Iterator storedIterator) {
00255 
00256         return (Iterator) ((StoredIterator) storedIterator).clone();
00257     }
00258 }

Generated on Sun Dec 25 12:14:31 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2