DeltaStream
open class DeltaStream : DataValue, @unchecked Sendable
A stream of delta items, each of which is either an EntityValue or a ChangedLink.
While processing a stream, a delta link may be encountered, but it will not be immediately available to the caller. The deltaLink can be obtained only after the stream is closed.
Example
let deltaStream = ...
while (deltaStream.next())
{
if (deltaStream.hasEntity())
{
let entity = deltaStream.getEntity()
// Process entity value.
}
else
{
let link = deltaStream.getLink()
// Process changed link.
}
}
deltaStream.close()
var deltaLink = deltaStream.deltaLink
// Save delta link for later use.
-
Has
closebeen called?Declaration
Swift
final public var isClosed: Bool -
The current delta item (an
EntityValueorChangedLink), ornil.Declaration
Swift
final public var deltaItem: AnyObject? -
The delta-link (if any) that was encountered when
nextwas called repeatedly until it returnedfalseand thenclosewas called, otherwisenil.Declaration
Swift
final public var deltaLink: String? -
The next-link (if any) that was encountered when
nextwas called repeatedly until it returnedfalseand thenclosewas called, otherwisenil.Declaration
Swift
final public var nextLink: String? -
The read-link (if any) that was encountered when
nextwas called repeatedly until it returnedfalseand thenclosewas called, otherwisenil.Declaration
Swift
final public var readLink: String? -
Default initializer.
Declaration
Swift
override public init() -
Close this stream and release all associated resources, without checking first that the end of stream has been reached.
See also
close.Declaration
Swift
open func abort() throws -
Close this stream and release all associated resources, checking first that the end of stream has been reached. Can safely be called even if the stream was previously closed. If a delta link was encountered before the stream was closed, it will be available via the
deltaLinkproperty only after the stream is closed. If a next link was encountered before the stream was closed, it will be available via thenextLinkproperty only after the stream is closed.See also
abort.Declaration
Swift
open func close() throws -
See also
hasCurrent.Declaration
Swift
open func current() throws -> AnyObject?Return Value
the current delta item (an
EntityValueorChangedLink), ornilif there is no current delta item. -
Data type with a
DataType.codeofDataType.DELTA_STREAM.Declaration
Swift
override open var dataType: DataType { get } -
Throws
UsageExceptionif there no current delta item or if the current delta item is a changed link.See also
getCurrent.Declaration
Swift
open func entity() throws -> EntityValueReturn Value
the current entity value.
-
See also
getCurrent.Declaration
Swift
open func hasCurrent() throws -> BoolReturn Value
trueif the if the stream has a current delta item (the most recent call tonextreturnedtrueandclosehas not been called)). -
Check if the stream has a current delta item which is an entity value.
See also
getEntity.Declaration
Swift
open func hasEntity() throws -> BoolReturn Value
trueifhasCurrentwould returntrueif called, and the current delta item is an entity value. -
Check if the stream has a current delta item which is a changed link.
See also
getLink.Declaration
Swift
open func hasLink() throws -> BoolReturn Value
trueifhasCurrentwould returntrueif called, and the current delta item is a changed link. -
Throws
UsageExceptionif there is no current delta item or if the current delta item is an entity value.See also
getCurrent.Declaration
Swift
open func link() throws -> ChangedLinkReturn Value
the current changed link.
-
If this stream has not been
closeand has a next delta item, then advance to the next delta item and returntrue. Otherwise returnfalse.See also
hasCurrent,hasEntity,hasLink,getCurrent,getEntity,getLink.Declaration
Swift
open func next() throws -> BoolReturn Value
trueif there is a next delta item available. -
Convert this data value to a string. If the
dataTypeis defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used. JSON format is used for structured values (arrays and objects).Declaration
Swift
override open func toString() -> StringReturn Value
Lexical representation of this data value.