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

String net::sf::json::JSONArray::optString ( int  index,
String  defaultValue 
) [inline]

Get the optional string associated with an index. The defaultValue is returned if the key is not found.

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

Definition at line 2285 of file JSONArray.java.

References opt().

                                                             {
      Object o = opt( index );
      return o != null ? o.toString() : defaultValue;
   }


Generated by  Doxygen 1.6.0   Back to index