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 unmodifiableMap<String, Object?>, lists (keys0..nwith more than half present) unmodifiableList<Object?>with null holes, at every depth; numbers that are integral within 2^53 read asint(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
indexorder untilactionreturns true; returns whether it did. -
getChild(
Path path) → Node -
The node at
pathbelow this one (empty when absent). -
getImmediateChild(
ChildKey key) → Node -
The child
key(empty when absent);.prioritygives the priority. -
getPredecessorChildKey(
ChildKey key, Node child, Index index) → ChildKey? -
The key of the child before
key(whose node ischild) inindexorder, or null. -
hasChild(
ChildKey key) → bool -
Whether child
keyexists. -
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
indexis 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
intordoubleper the number rules), strings, booleans or null. WithexportFormat, priorities appear as.priorityand 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
pathreplaced bynewChild. -
updateImmediateChild(
ChildKey key, Node newChild) → Node -
This node with child
keyreplaced bynewChild(removed when empty). -
updatePriority(
Node newPriority) → Node -
This node with
newPriority. -
withIndex(
Index index) → Node -
This node with an index on
indexadded (children nodes only).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited