ArrayInterface

ArrayInterface defines a set of methods for readonly accessing array data.

Inheritors

Properties

Link copied to clipboard
abstract val count: Int

The number of the items in the array.

Functions

Link copied to clipboard
operator fun ArrayInterface.get(index: Int): Fragment

Subscript access to a Fragment object of the projecting result value at the given index.

Link copied to clipboard
abstract fun getArray(index: Int): Array?

Gets value at the given index as an Array. Returns null if the value doesn't exist, or its value is not an Array.

Link copied to clipboard
abstract fun getBlob(index: Int): Blob?

Gets value at the given index as a Blob. Returns null if the value doesn't exist, or its value is not a Blob.

Link copied to clipboard
abstract fun getBoolean(index: Int): Boolean

Gets value at the given index as a boolean.

Link copied to clipboard
abstract fun getDate(index: Int): Instant?

Gets value at the given index as a Date. JSON does not directly support dates, so the actual property value must be a string, which is then parsed according to the ISO-8601 date format (the default used in JSON.) Returns null if the value doesn't exist, is not a string, or is not parsable as a date. NOTE: This is not a generic date parser! It only recognizes the ISO-8601 format, with or without milliseconds.

Link copied to clipboard
abstract fun getDictionary(index: Int): Dictionary?

Gets a Dictionary at the given index. Return null if the value is not a dictionary.

Link copied to clipboard
abstract fun getDouble(index: Int): Double

Gets value at the given index as a double. Integers will be converted to double. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the property doesn't exist or does not have a numeric value.

Link copied to clipboard
abstract fun getFloat(index: Int): Float

Gets value at the given index as a float. Integers will be converted to float. The value true is returned as 1.0, false as 0.0. Returns 0.0 if the value doesn't exist or does not have a numeric value.

Link copied to clipboard
abstract fun getInt(index: Int): Int

Gets value at the given index as an int. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

Link copied to clipboard
abstract fun getLong(index: Int): Long

Gets value at the given index as a long. Floating point values will be rounded. The value true is returned as 1, false as 0. Returns 0 if the value doesn't exist or does not have a numeric value.

Link copied to clipboard
abstract fun getNumber(index: Int): Number?

Gets value at the given index as a Number. Returns null if the value doesn't exist, or its value is not a Number.

Link copied to clipboard
abstract fun getString(index: Int): String?

Gets value at the given index as a String. Returns null if the value doesn't exist, or its value is not a String.

Link copied to clipboard
abstract fun getValue(index: Int): Any?

Gets value at the given index as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or null if the value is null.

Link copied to clipboard
abstract fun toJSON(): String

Encode an Array as a JSON string

Link copied to clipboard
abstract fun toList(): List<Any?>

Gets content of the current object as a List. The values contained in the returned List object are all JSON based values.