Skip to main content
Version: v1

RevisionView Class

An immutable view of a distributed tree.

Signature

export declare class RevisionView extends TreeView

Extends: TreeView

Static Methods

Method Return Type Description
fromTree(root, expensiveValidation) RevisionView Constructs a RevisionView using the supplied tree.
fromTree(root, idConverter, expensiveValidation) RevisionView Constructs a RevisionView using the supplied tree.

Methods

Method Return Type Description
equals(view) boolean
openForTransaction() TransactionView Begin a transaction by generating a mutable TransactionView from this view

Method Details

equals

Signature

equals(view: TreeView): boolean;

Parameters

Parameter Type Description
view TreeView

Returns

Return type: boolean

fromTree

Constructs a RevisionView using the supplied tree.

Signature

static fromTree<T extends TreeNode<T, NodeId>>(root: T, expensiveValidation?: boolean): RevisionView;
Type Parameters
Parameter Constraint Description
T TreeNode<T, NodeId>

Parameters

Parameter Modifiers Type Description
root T the root of the tree to use as the contents of the RevisionView
expensiveValidation optional boolean whether or not to perform additional validation, e.g. to catch errors when testing

Returns

Return type: RevisionView

fromTree

Constructs a RevisionView using the supplied tree.

Signature

static fromTree<T extends TreeNode<T, StableNodeId>>(root: T, idConverter: NodeIdConverter, expensiveValidation?: boolean): RevisionView;
Type Parameters
Parameter Constraint Description
T TreeNode<T, StableNodeId>

Parameters

Parameter Modifiers Type Description
root T the root of the tree to use as the contents of the RevisionView
idConverter NodeIdConverter the NodeIdConverter that will recompress the IDs the in the tree
expensiveValidation optional boolean whether or not to perform additional validation, e.g. to catch errors when testing

Returns

Return type: RevisionView

openForTransaction

Begin a transaction by generating a mutable TransactionView from this view

Signature

openForTransaction(): TransactionView;

Returns

Return type: TransactionView