01: /* ========================================================================
02: * JCommon : a free general purpose class library for the Java(tm) platform
03: * ========================================================================
04: *
05: * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
06: *
07: * Project Info: http://www.jfree.org/jcommon/index.html
08: *
09: * 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: * Checks, whether a given property is defined.
52: *
53: * @param name the name of the property
54: * @return true, if the property is defined, false otherwise.
55: */
56: public boolean isPropertySet(String name);
57:
58: /**
59: * Returns a given property as int value. Zero is returned if the
60: * property value is no number or the property is not set.
61: *
62: * @param name the name of the property
63: * @return the parsed number value or zero
64: */
65: public int getIntProperty(String name);
66:
67: /**
68: * Returns a given property as int value. The specified default value is returned if the
69: * property value is no number or the property is not set.
70: *
71: * @param name the name of the property
72: * @param defaultValue the value to be returned if the property is no integer value
73: * @return the parsed number value or the specified default value
74: */
75: public int getIntProperty(String name, int defaultValue);
76:
77: /**
78: * Returns the boolean value of a given configuration property. The boolean value true
79: * is returned, if the contained string is equal to 'true'.
80: *
81: * @param name the name of the property
82: * @return the boolean value of the property.
83: */
84: public boolean getBoolProperty(String name);
85:
86: /**
87: * Returns the boolean value of a given configuration property. The boolean value true
88: * is returned, if the contained string is equal to 'true'. If the property is not set,
89: * the default value is returned.
90: *
91: * @param name the name of the property
92: * @param defaultValue the default value to be returned if the property is not set
93: * @return the boolean value of the property.
94: */
95: public boolean getBoolProperty(String name, boolean defaultValue);
96: }
|