Logo Search packages:      
Sourcecode: libjson-java version File versions

double net::sf::json::JSONArray::optDouble ( int  index,
double  defaultValue 
) [inline]

Get the optional double value associated with an index. The defaultValue is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number.

Parameters:
index subscript
defaultValue The default value.
Returns:
The value.

Definition at line 2174 of file JSONArray.java.

References getDouble().

                                                             {
      try{
         return getDouble( index );
      }catch( Exception e ){
         return defaultValue;
      }
   }


Generated by  Doxygen 1.6.0   Back to index