public int getInteger(String key, int defaultValue)
    {
        int ret;
        try
        {
            String tmp = properties.getProperty(key);
            if (tmp == null)
            {
                properties.put(key, String.valueOf(defaultValue));
                logger.debug("No value for key \"" + key + "\", using default "
                        + defaultValue + ".");
                return defaultValue;
            }
            ret = Integer.parseInt(tmp);
        }
        catch (NumberFormatException e)
        {
            Object wrongValue = properties.put(key, String.valueOf(defaultValue));
            logger.warn(
                    "Value \""
                    + wrongValue
                    + "\" is illegal for key \""
                    + key
                    + "\" (should be an integer, using default value "
                    + defaultValue
                    + ")");
            ret = defaultValue;
        }
        return ret;
    }
public int getInteger ( String key , int defaultValue ) { int ret ; try { String tmp = properties . getProperty ( key ) ; if ( tmp == null ) { properties . put ( key , String . valueOf ( defaultValue ) ) ; logger . debug ( "No value for key \"" + key + "\", using default " + defaultValue + "." ) ; return defaultValue ; } ret = Integer . parseInt ( tmp ) ; } catch ( NumberFormatException e ) { Object wrongValue = properties . put ( key , String . valueOf ( defaultValue ) ) ; logger . warn ( "Value \"" + wrongValue + "\" is illegal for key \"" + key + "\" (should be an integer, using default value " + defaultValue + ")" ) ; ret = defaultValue ; } return ret ; }
Returns the integer value for the specified key. If no value for this key
is found in the configuration or the value is not an legal integer
<code>defaultValue</code> is returned.

@param key the key
@param defaultValue the default Value
@return the value for the key, or <code>defaultValue</code>