Frames | No Frames |
1: /* ======================================================================== 2: * JCommon : a free general purpose class library for the Java(tm) platform 3: * ======================================================================== 4: * 5: * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. 6: * 7: * Project Info: http://www.jfree.org/jcommon/index.html 8: * 9: * This library is free software; you can redistribute it and/or modify it 10: * under the terms of the GNU Lesser General Public License as published by 11: * the Free Software Foundation; either version 2.1 of the License, or 12: * (at your option) any later version. 13: * 14: * This library is distributed in the hope that it will be useful, but 15: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17: * License for more details. 18: * 19: * You should have received a copy of the GNU Lesser General Public 20: * License along with this library; if not, write to the Free Software 21: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 22: * USA. 23: * 24: * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 25: * in the United States and other countries.] 26: * 27: * ------------- 28: * ExtendedConfiguration.java 29: * ------------- 30: * (C)opyright 2002-2005, by Thomas Morgner and Contributors. 31: * 32: * Original Author: Thomas Morgner; 33: * Contributor(s): David Gilbert (for Object Refinery Limited); 34: * 35: * $Id: ExtendedConfiguration.java,v 1.3 2005/10/18 13:24:19 mungady Exp $ 36: * 37: * Changes 38: * ------- 39: * 20-May-2005 : Initial version. 40: */ 41: package org.jfree.util; 42: 43: /** 44: * The extended configuration provides methods to make using the 45: * configuration easier. 46: * 47: * @author Thomas Morgner 48: */ 49: public interface ExtendedConfiguration extends Configuration 50: { 51: /** 52: * Checks, whether a given property is defined. 53: * 54: * @param name the name of the property 55: * @return true, if the property is defined, false otherwise. 56: */ 57: public boolean isPropertySet (String name); 58: 59: /** 60: * Returns a given property as int value. Zero is returned if the 61: * property value is no number or the property is not set. 62: * 63: * @param name the name of the property 64: * @return the parsed number value or zero 65: */ 66: public int getIntProperty (String name); 67: 68: /** 69: * Returns a given property as int value. The specified default value is returned if the 70: * property value is no number or the property is not set. 71: * 72: * @param name the name of the property 73: * @param defaultValue the value to be returned if the property is no integer value 74: * @return the parsed number value or the specified default value 75: */ 76: public int getIntProperty (String name, int defaultValue); 77: 78: /** 79: * Returns the boolean value of a given configuration property. The boolean value true 80: * is returned, if the contained string is equal to 'true'. 81: * 82: * @param name the name of the property 83: * @return the boolean value of the property. 84: */ 85: public boolean getBoolProperty (String name); 86: 87: /** 88: * Returns the boolean value of a given configuration property. The boolean value true 89: * is returned, if the contained string is equal to 'true'. If the property is not set, 90: * the default value is returned. 91: * 92: * @param name the name of the property 93: * @param defaultValue the default value to be returned if the property is not set 94: * @return the boolean value of the property. 95: */ 96: public boolean getBoolProperty (String name, boolean defaultValue); 97: }