Class: PartialResult

olympe.dc.api. PartialResult

Tree-like data structure representing a QueryResult in construction Each time a 'follow' is used, an additional level is created in the tree The different query parts all modify a PartialResult to answer the query


new PartialResult(query)

Parameters:
Name Type Description
query olympe.dc.Query

Methods


ackUpdate()

Use this method to reset update status on partial result. Current result value has been transmitted and additional changes will trigger a new update


getComparator()

Return the comparator associated to that query

Returns:

comparator

Type
olympe.dc.api.PartialResult.Comparator

getEntriesAt(level)

Result entries for the given level

Parameters:
Name Type Description
level number
Returns:
Type
Map.<string, !Set.<string>>

getLevelsToReturn()

The list of levels that will be part of the query result.

Returns:
Type
Array.<number>

getMax()

Returns:
Type
number | undefined

getOffset()

Returns:
Type
number

getParentsTags(tag, level)

Parents tag at level-1 of node tag at level

Parameters:
Name Type Description
tag string
level number
Returns:
Type
Array.<string>

getTuples()

Returns tuples for query result

Returns:
Type
Array.<!Array.<string>>

insert(tag, level, parentTag)

Insert a node into the partial result. If the node being added already exists at that path depth, we only register the new parent as parent of the node.

Parameters:
Name Type Argument Description
tag string

node's tag

level number

level of the node 'tag'

parentTag string <nullable>
Returns:

if the node did not already exist at the path depth

Type
boolean

notifyUpdate()

The partial result has a change that needs to be transmitted to the query manager The callback provided by the onUpdate(callback)


onUpdate(callback)

Sets callback to notify query manager the result has changed

Parameters:
Name Type Description
callback function

remove(tag, level, parentTag)

Removes a node-parent relation A node is totally removed if it has no parent

Parameters:
Name Type Argument Description
tag string
level number

the level of node 'tag'

parentTag string <nullable>
Returns:

if a node was removed from last result level

Type
boolean

setComparator(comparator, level, order, property)

Parameters:
Name Type Description
comparator function
level number
order olympe.dc.api.Order
property olympe.dc.registry.Property

Type Definitions


Comparator

Type:
  • Object
Properties:
Name Type Description
comparator function
comparatorLevel number
order olympe.dc.api.Order
property olympe.dc.registry.Property