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

boolean net::sf::json::JSONArray::optBoolean ( int  index,
boolean  defaultValue 
) [inline]

Get the optional boolean value associated with an index. It returns the defaultValue if there is no value at that index or if it is not a Boolean or the String "true" or "false" (case insensitive).

Parameters:
index The index must be between 0 and size() - 1.
defaultValue A boolean default.
Returns:
The truth.

Definition at line 2145 of file JSONArray.java.

References getBoolean().

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


Generated by  Doxygen 1.6.0   Back to index