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

CompactConfig.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: CompactConfig.java,v 12.2 2005/11/02 03:14:12 mjc Exp $
00008  */
00009 
00010 package com.sleepycat.db;
00011 
00012 import com.sleepycat.db.internal.DbConstants;
00013 
00014 public class CompactConfig implements Cloneable {
00015     public static final CompactConfig DEFAULT = new CompactConfig();
00016 
00017     /* package */
00018     static CompactConfig checkNull(CompactConfig config) {
00019         return (config == null) ? DEFAULT : config;
00020     }
00021 
00022     private int fillpercent = 0;
00023     private boolean freeListOnly = false;
00024     private boolean freeSpace = false;
00025     private int maxPages = 0;
00026     private int timeout = 0;
00027 
00028     public CompactConfig() {
00029     }
00030 
00031     public void setFillPercent(final int fillpercent) {
00032         this.fillpercent = fillpercent;
00033     }
00034 
00035     public int getFillPercent() {
00036         return fillpercent;
00037     }
00038 
00039     public void setFreeListOnly(boolean freeListOnly) {
00040         this.freeListOnly = freeListOnly;
00041     }
00042 
00043     public boolean getFreeListOnly() {
00044         return freeListOnly;
00045     }
00046 
00047     public void setFreeSpace(boolean freeSpace) {
00048         this.freeSpace = freeSpace;
00049     }
00050 
00051     public boolean getFreeSpace() {
00052         return freeSpace;
00053     }
00054 
00055     public void setMaxPages(final int maxPages) {
00056         this.maxPages = maxPages;
00057     }
00058 
00059     public int getMaxPages() {
00060         return maxPages;
00061     }
00062 
00063     public void setTimeout(final int timeout) {
00064         this.timeout = timeout;
00065     }
00066 
00067     public int getTimeout() {
00068         return timeout;
00069     }
00070 
00071     /* package */
00072     int getFlags() {
00073         int flags = 0;
00074         flags |= freeListOnly ? DbConstants.DB_FREELIST_ONLY : 0;
00075         flags |= freeSpace ? DbConstants.DB_FREE_SPACE : 0;
00076 
00077         return flags;
00078     }
00079 }

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