util.JSONArray class

 

util.JSONArray class is used to modify and manipulate ordered lists of values following the JSON string syntax.

 

JSON array is an ordered list of value pairs. JSON arrays are enclosed in square brackets - [ to begin the array and ] to end it. Values are separated by , (comma):

 

[234,3456,24656,34561]

[a, ab, abc, aa, aabb, aabbcc]

 

JSON arrays are created by the util.JSONArray.create() method.

Once created, JSON arrays can be studied and manipulated by util.JSONObject methods summarized in the table below.

 

method

description and examples

util.JSONArray.create()

creates a new JSON array

 

util.JSONArray.fromFGL()

creates a new JSON array from a DYNAMIC ARRAY

 

util.JSONArray.parse()

parses a JSON string into a new JSON array

 

util.JSONArray.get()

returns a value of a member of the JSON array

 

util.JSONArray.getLength()

returns the number of the members included in the specified JSON array

 

util.JSONArray.getType()

returns the type of the member of the specified JSON array

 

util.JSONArray.put()

adds a new member to the specified JSON array

 

util.JSONArray.remove()

removes the specified member from the JSON array

 

util.JSONArray.toFGL()

fills a DYNAMIC ARRAY with the elements of the JSON array

 

util.JSONArray.toString()

produces a JSON string from the values included in the JSON array