Node class

An abstract node in a document tree.

Represents a segment of a Notus document with specified offset and length.

The offset property is relative to parent. See also documentOffset which provides absolute offset of this node within the document.

The current parent node is exposed by the parent property. A node is considered mounted when the parent property is not null.

Inheritance
Implementers

Constructors

Node()

Properties

documentOffset int
Offset in characters of this node in the document.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isFirst bool
Returns true if this node is the first node in the parent list.
read-only
isLast bool
Returns true if this node is the last node in the parent list.
read-only
length int
Length of this node in characters.
read-only
list LinkedList<Node>
Get the linked list containing this element. [...]
read-only, inherited
mounted bool
Returns true if this node is currently mounted, e.g. parent is not null.
read-only
next Node
Return the successor of this element in its linked list. [...]
read-only, inherited
offset int
Offset in characters of this node relative to parent node. [...]
read-only
parent ContainerNode<Node>
Current parent of this node. May be null if this node is not mounted.
read-only
previous Node
Return the predecessor of this element in its linked list. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

containsOffset(int offset) bool
Returns true if this node contains character at specified offset in the document.
delete(int index, int length) → void
Delete length characters of this node starting from index.
insert(int index, String text, NotusStyle style) → void
Insert text at specified character index with style style.
insertAfter(Node entry) → void
Insert an element after this element in this element's linked list. [...]
override
insertBefore(Node entry) → void
Insert an element before this element in this element's linked list. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
optimize() → void
Optimize this node within parent. [...]
@protected
retain(int index, int length, NotusStyle style) → void
Format length characters of this node starting from index with specified style style.
toDelta() Delta
Returns Delta representation of this node.
toPlainText() String
Returns plain-text representation of this node.
toString() String
Returns a string representation of this object.
inherited
Unlink the element from its linked list. [...]
override

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited