Sophie

Sophie

distrib > Mageia > 3 > x86_64 > media > core-release-src > by-pkgid > c0c65e52e17f68c801504818e2c983cd > files > 1

excalibur-configuration-1.1-3.mga3.src.rpm

--- src/java/org/apache/excalibur/configuration/CascadingConfiguration.java	2003-09-12 19:01:11.000000000 +0200
+++ src/java/org/apache/excalibur/configuration/CascadingConfiguration.java-gil	2011-05-28 10:54:53.062696151 +0200
@@ -342,6 +342,26 @@
     }
 
     /**
+     * Return the <code>double</code> value of the specified parameter contained
+     * in this node.
+     * @param paramName The name of the parameter you ask the value of.
+     * @return double value of attribute
+     * @exception ConfigurationException If no parameter with that name exists.
+     *                                   or if conversion to <code>float</code> fails.
+     */
+    public double getAttributeAsDouble( String paramName ) throws ConfigurationException
+    {
+        try
+        {
+            return m_base.getAttributeAsDouble( paramName );
+        }
+        catch( ConfigurationException e )
+        {
+            return m_parent.getAttributeAsDouble( paramName );
+        }
+    }
+
+    /**
      * Return the <code>boolean</code> value of the specified parameter contained
      * in this node.
      *
@@ -417,6 +437,24 @@
     }
 
     /**
+     * Return the <code>double</code> value of the node.
+     *
+     * @return the value of the node.
+     * @exception ConfigurationException If conversion to <code>double</code> fails.
+     */
+    public double getValueAsDouble() throws ConfigurationException
+    {
+        try
+        {
+            return m_base.getValueAsDouble();
+        }
+        catch( ConfigurationException e )
+        {
+            return m_parent.getValueAsDouble();
+        }
+    }
+
+    /**
      * Return the <code>boolean</code> value of the node.
      *
      * @return the value of the node.
@@ -537,6 +575,27 @@
     }
 
     /**
+     * Returns the value of the configuration element as a <code>double</code>.
+     * If the configuration value is not set, the default value will be
+     * used.
+     *
+     * @param defaultValue The default value desired.
+     * @return double value of the <code>Configuration</code>, or default
+     *          if none specified.
+     */
+    public double getValueAsDouble( double defaultValue )
+    {
+        try
+        {
+            return m_base.getValueAsDouble();
+        }
+        catch( ConfigurationException e )
+        {
+            return m_parent.getValueAsDouble( defaultValue );
+        }
+    }
+
+    /**
      * Returns the value of the configuration element as a <code>boolean</code>.
      * If the configuration value is not set, the default value will be
      * used.
@@ -649,6 +708,29 @@
         }
     }
 
+    /**
+     * Returns the value of the attribute specified by its name as a
+     * <code>double</code>, or the default value if no attribute by
+     * that name exists or is empty.
+     *
+     * @param name The name of the attribute you ask the value of.
+     * @param defaultValue The default value desired.
+     * @return double value of attribute. It will return the default
+     *          value if the named attribute does not exist, or if
+     *          the value is not set.
+     */
+    public double getAttributeAsDouble( String name, double defaultValue )
+    {
+        try
+        {
+            return m_base.getAttributeAsDouble( name );
+        }
+        catch( ConfigurationException e )
+        {
+            return m_parent.getAttributeAsDouble( name, defaultValue );
+        }
+    }
+
     /**
      * Returns the value of the attribute specified by its name as a
      * <code>boolean</code>, or the default value if no attribute by