JSONArray Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A dense indexed sequence of values.
[Android.Runtime.Register("org/json/JSONArray", DoNotGenerateAcw=true)]
public class JSONArray : Java.Lang.Object
[<Android.Runtime.Register("org/json/JSONArray", DoNotGenerateAcw=true)>]
type JSONArray = class
inherit Object
- Inheritance
- Attributes
Remarks
A dense indexed sequence of values. Values may be any mix of JSONObject JSONObjects
, other JSONArray JSONArrays
, Strings, Booleans, Integers, Longs, Doubles, null
or JSONObject#NULL
. Values may not be Double#isNaN() NaNs
, Double#isInfinite() infinities
, or of any type not listed here.
JSONArray
has the same type coercion behavior and optional/mandatory accessors as JSONObject
. See that class' documentation for details.
<strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java null
reference, and the sentinel value JSONObject#NULL
. In particular, get
fails if the requested index holds the null reference, but succeeds if it holds JSONObject.NULL
.
Instances of this class are not thread safe. Although this class is nonfinal, it was not designed for inheritance and should not be subclassed. In particular, self-use by overridable methods is not specified. See Effective Java Item 17, "Design and Document or inheritance or else prohibit it" for further information.
Java documentation for org.json.JSONArray
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
JSONArray() |
Creates a |
JSONArray(ICollection) |
Creates a new |
JSONArray(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
JSONArray(JSONTokener) |
Creates a new |
JSONArray(Object) |
Creates a new |
JSONArray(String) |
Creates a new |
Properties
Class |
Returns the runtime class of this |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
PeerReference | (Inherited from Object) |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
Methods
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
Get(Int32) |
Returns the value at |
GetBoolean(Int32) |
Returns the value at |
GetDouble(Int32) |
Returns the value at |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
GetInt(Int32) |
Returns the value at |
GetJSONArray(Int32) |
Returns the value at |
GetJSONObject(Int32) |
Returns the value at |
GetLong(Int32) |
Returns the value at |
GetString(Int32) |
Returns the value at |
IsNull(Int32) |
Returns true if this array has no value at |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
Join(String) |
Returns a new string by alternating this array's values with |
Length() |
Returns the number of values in this array. |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
Opt(Int32) |
Returns the value at |
OptBoolean(Int32, Boolean) |
Returns the value at |
OptBoolean(Int32) |
Returns the value at |
OptDouble(Int32, Double) |
Returns the value at |
OptDouble(Int32) |
Returns the value at |
OptInt(Int32, Int32) |
Returns the value at |
OptInt(Int32) |
Returns the value at |
OptJSONArray(Int32) |
Returns the value at |
OptJSONObject(Int32) |
Returns the value at |
OptLong(Int32, Int64) |
Returns the value at |
OptLong(Int32) |
Returns the value at |
OptString(Int32, String) |
Returns the value at |
OptString(Int32) |
Returns the value at |
Put(Boolean) |
Appends |
Put(Double) |
Appends |
Put(Int32, Boolean) |
Sets the value at |
Put(Int32, Double) |
Sets the value at |
Put(Int32, Int32) |
Sets the value at |
Put(Int32, Int64) |
Sets the value at |
Put(Int32, Object) |
Sets the value at |
Put(Int32) |
Appends |
Put(Int64) |
Appends |
Put(Object) |
Appends |
Remove(Int32) |
Removes and returns the value at |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
ToArray<T>() | (Inherited from Object) |
ToJSONObject(JSONArray) |
Returns a new object whose values are the values in this array, and whose
names are the values in |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
ToString(Int32) |
Encodes this array as a human readable JSON string for debugging, such as: |
UnregisterFromRuntime() | (Inherited from Object) |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |