-
Undocumented
Declaration
Swift
public subscript(index: Int) -> DataValue
-
An immutable empty
DataValueList
.Declaration
Swift
public static let empty: DataValueList = DataValueList(capacity: Int(Int32.min))
-
true
if this list is a referece. Iftrue
, thereadLink
will be non-null, and this list will be empty.Declaration
Swift
final public var isReference: Bool = false
-
An optional link that can be followed (by the caller, not by this DataValueList) to fetch additional list items. If this value list was produced via server-driven paging, then the server may have provided a next-link which can be followed to obtain more items.
Declaration
Swift
final public var nextLink: String?
-
An optional link that can be followed (by the caller, not by this DataValueList) to re-read this list.
Declaration
Swift
final public var readLink: String?
-
Total number of items available in the server-side list, which may be greater than
length
if the client requested an inlineDataQuery.count
.Declaration
Swift
final public var totalCount: Int64?
-
Construct a new list with
length
of zero and optional initialcapacity
. A list can expand in length beyond its initial capacity, but best performance will be obtained if the initial capacity is close to the list’s maximum length.Declaration
Swift
override public init(capacity: Int = (4 as Int))
Parameters
capacity
Optional initial capacity.
-
Add
item
to the end of this list.Declaration
Swift
open func append(_ item: DataValue) -> Void
Parameters
item
Item to be added.
-
Add all the items of
list
to the end of this list.Declaration
Swift
open func append(contentsOf list: DataValueList) -> Void
Parameters
list
Items to be added.
-
Append
item
to the end of this list. It is unusual for aDataValueList
to containnil
items, soadd
is usually used.Declaration
Swift
open func appendOptional(_ item: DataValue?) -> DataValueList
Parameters
item
Item to be added, which might be
nil
.Return Value
This list.
-
Declaration
Swift
open func copy() -> DataValueList
Return Value
A shallow copy of this list.
-
The data type for this list.
Declaration
Swift
override open var dataType: DataType
-
See also
DataEquality
.Declaration
Swift
open class func equal(a: DataValueList?, b: DataValueList?) -> Bool
Parameters
a
First value list.
b
Second value list.
Return Value
true
if two value lists have equal items. -
Throws
EmptyListException
if the list is empty.Declaration
Swift
open func first() -> DataValue
Return Value
The first item in this list.
-
Convert array to list.
Declaration
Swift
open class func fromArray(_ array: Array<DataValue>) -> DataValueList
Parameters
array
Array with source items.
Return Value
New list with items copied from
array
parameter. -
Convert array to list.
Declaration
Swift
open class func fromArray(_ array: Array<DataValue?>) -> DataValueList
Parameters
array
Array with source items.
Return Value
New list with items copied from
array
parameter. -
Declaration
Swift
open func indexOf(item: DataValue, start: Int = (0 as Int)) -> Int
Parameters
item
Item for comparison. Comparison uses the
equality
property, which would usually be expected to match the==
operator for item typeDataValue
.start
Zero-based starting index (search moves forwards from this index).
Return Value
First index in this list of
item
, or-1
if not found. -
Insert
item
into this list, before the item (if any) atindex
.Throws
ListIndexException
ifindex
is out of range (0 tolength
).Declaration
Swift
open func insert(at index: Int, item: DataValue) -> Void
Parameters
index
Zero-based index.
item
Item to be added.
-
Insert all items of
list
into this list, before the item (if any) atindex
.Throws
ListIndexException
ifindex
is out of range (0 tolength
).Declaration
Swift
open func insert(at index: Int, contentsOf list: DataValueList) -> Void
Parameters
index
Zero-based index.
list
List of items to be inserted.
-
Throws
ListIndexException
ifindex
is out of range (0 tolength
- 1).Declaration
Swift
open func item(at index: Int) -> DataValue
Parameters
index
Zero-based index.
Return Value
The item in this list at the specified
index
. -
Throws
EmptyListException
if the list is empty.Declaration
Swift
open func last() -> DataValue
Return Value
The last item in this list.
-
Declaration
Swift
open func lastIndexOf(item: DataValue, start: Int = (2147483647 as Int)) -> Int
Parameters
item
Item for comparison. Comparison uses the
equality
property, which would usually be expected to match the==
operator for item typeDataValue
.start
Zero-based starting index (search moves backwards from this index).
Return Value
Last index in this list of
item
, or-1
if not found. -
Declaration
Swift
open func makeIterator() -> IndexingIterator<Array<DataValue>>
Return Value
This list converted to a Swift iterator.
-
Throws
ListIndexException
ifindex
is out of range (0 tolength
- 1).Declaration
Swift
open func optionalItem(at index: Int) -> DataValue?
Parameters
index
Zero-based index.
Return Value
The item in this list at the specified
index
, which might benil
. It is unusual for aDataValueList
to containnil
items, soget
is usually used (althoughget
will throw an exception for anil
item). -
Return a new
DataValueList
that shares theListBase.untypedList
as thelist
parameter. To ensure type safety, items inlist
that do not have the item typeDataValue
will be removed.Declaration
Swift
open class func share(_ list: ListBase) -> DataValueList
Parameters
list
List whose items will be shared by the resulting list.
Return Value
A new list of item type
DataValue
, sharing the same items aslist
. -
Return a new DataValueList that shares the
ListBase.untypedList
as thelist
parameter, including nulls. To ensure type safety, items inlist
that do not have the item type will be removed.Declaration
Swift
open class func shareOptional(_ list: ListBase) -> DataValueList
Parameters
list
List whose items will be shared by the resulting list.
Return Value
A new list of item type
DataValue
, sharing the same items aslist
. -
Throws
EmptyListException
if the list has no items,NotUniqueException
if the list has multiple items.Declaration
Swift
open func single() -> DataValue
Return Value
A single item from this list.
-
Declaration
Swift
open func slice(start: Int, end: Int = (2147483647 as Int)) -> DataValueList
Parameters
start
Zero-based starting index (inclusive), or negative for starting index relative to the end of this list.
end
Zero-based ending index (exclusive), or negative for ending index relative to the end of this list.
Return Value
A slice of this list from index
start
(inclusive) to indexend
(exclusive). -
Convert list to array.
Declaration
Swift
open func toArray() -> Array<DataValue>
Return Value
New array with items copied from this list.
-
Set the item in this list at the specified
index
.Declaration
Swift
open func update(at index: Int, item: DataValue) -> Void
Parameters
index
Zero-based index.
item
Item value.
-
Set the item in this list at the specified
index
. It is unusual for aDataValueList
to containnil
items, soset
is usually used.Declaration
Swift
open func updateOptional(at index: Int, item: DataValue?) -> Void
Parameters
index
Zero-based index.
item
Item value, which might be
nil
. -
Override the type of this list, and return this list.
Declaration
Swift
open func withItemType(_ type: DataType) -> DataValueList
Parameters
type
Data type for the items in this list.
Return Value
This list.
-
See also
share
.Declaration
Swift
open func withNulls() -> DataValueListWithNulls
Return Value
An iterator of this list which uses a nullable item type.
-
Override the type of this list, and return this list.
Declaration
Swift
open func withType(_ type: DataType) -> DataValueList
Parameters
type
Data type for a list of data values. Use
DataType.listOf
to obtain a suitable list type.Return Value
This list.