Node class abstract interface

An immutable database value: a leaf or a set of children, each with a priority.

Implemented types

Properties

hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Whether this node is empty (no value, no children).
no setter
isLeafNode → bool
Whether this is a leaf.
no setter
numChildren → int
The number of children.
no setter
priority → Node
The priority node (empty when there is none).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → Object?
The plain value (JS val()), memoised and unmodifiable: the first read builds it, later reads return the same object. Maps are unmodifiable Map<String, Object?>, lists (keys 0..n with more than half present) unmodifiable List<Object?> with null holes, at every depth; numbers that are integral within 2^53 read as int (negative zero stays -0.0); null for the empty node.
no setter

Methods

compareTo(Node other) → int
Compares this object to another object.
inherited
forEachChild(Index index, ChildVisitor action) → bool
Visits the children in index order until action returns true; returns whether it did.
getChild(Path path) → Node
The node at path below this one (empty when absent).
getImmediateChild(ChildKey key) → Node
The child key (empty when absent); .priority gives the priority.
getPredecessorChildKey(ChildKey key, Node child, Index index) → ChildKey?
The key of the child before key (whose node is child) in index order, or null.
hasChild(ChildKey key) → bool
Whether child key exists.
hash() → String
The base64 SHA-1 hash of the node, equal to the JS SDK's for the same data.
override
isIndexed(Index index) → bool
Whether index is already built.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson({bool exportFormat = false}) → Object?
The JSON value as a fresh, mutable copy: maps and growable lists (at every depth), numbers (num as int or double per the number rules), strings, booleans or null. With exportFormat, priorities appear as .priority and leaves with a priority as {'.value': v, '.priority': p} (the put wire form; numbers as stored).
toString() → String
A string representation of this object.
inherited
updateChild(Path path, Node newChild) → Node
This node with the node at path replaced by newChild.
updateImmediateChild(ChildKey key, Node newChild) → Node
This node with child key replaced by newChild (removed when empty).
updatePriority(Node newPriority) → Node
This node with newPriority.
withIndex(Index index) → Node
This node with an index on index added (children nodes only).

Operators

operator ==(Object other) → bool
The equality operator.
inherited