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

StatsConfig.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: StatsConfig.java,v 12.1 2005/06/16 20:23:04 bostic Exp $
00008  */
00009 
00010 package com.sleepycat.db;
00011 
00012 import com.sleepycat.db.internal.DbConstants;
00013 
00014 public class StatsConfig {
00015     /*
00016      * For internal use, to allow null as a valid value for
00017      * the config parameter.
00018      */
00019     public static final StatsConfig DEFAULT = new StatsConfig();
00020 
00021     /* package */
00022     static StatsConfig checkNull(StatsConfig config) {
00023         return (config == null) ? DEFAULT : config;
00024     }
00025 
00026     private boolean clear = false;
00027     private boolean fast = false;
00028 
00029     public StatsConfig() {
00030     }
00031 
00032     public void setClear(boolean clear) {
00033         this.clear = clear;
00034     }
00035 
00036     public boolean getClear() {
00037         return clear;
00038     }
00039 
00040     public void setFast(boolean fast) {
00041         this.fast = fast;
00042     }
00043 
00044     public boolean getFast() {
00045         return fast;
00046     }
00047 
00048     int getFlags() {
00049         int flags = 0;
00050         if (fast)
00051                 flags |= DbConstants.DB_FAST_STAT;
00052         if (clear)
00053                 flags |= DbConstants.DB_STAT_CLEAR;
00054         return flags;
00055     }
00056 }

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