JSONArray

data class JSONArray(elements: MutableList<JSONElement>) : JSONElement

JSON array. Can contain any JSONElements.

Constructors

Link copied to clipboard
constructor(elements: MutableList<JSONElement>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun accept(visitor: JSONVisitor)
Link copied to clipboard
fun add(element: JSONElement)

Adds a JSONElement to the array.

Link copied to clipboard
Link copied to clipboard

Is the given JSONElement in the array?

Link copied to clipboard
fun findAncestor(type: KClass<out JSONElement>, predicate: (JSONElement) -> Boolean = {true}): JSONElement?

Finds the first ancestor of the current JSONElement whose class matches type and which verifies a predicate.

Link copied to clipboard
fun get(index: Int): JSONElement

Gets the JSONElement at the given index.

Link copied to clipboard

Returns a List of all the JSONElements contained in the array.

Link copied to clipboard
fun remove(element: JSONElement)

Removes a JSONElement from the array.

Link copied to clipboard
fun removeAt(index: Int): JSONElement

Removes and returns the JSONElement from the position index.

Link copied to clipboard
Link copied to clipboard

Replaces a JSONElement with a new element.

Link copied to clipboard
fun set(index: Int, element: JSONElement)

Sets the array JSONElement at the given index.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val length: Int

The number of JSONElements in the array.