Node class abstract
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
-
- Object
- LinkedListEntry<
Node> - Node
- Implementers
Constructors
- Node()
Properties
- documentOffset → int
-
Offset in characters of this node in the document.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFirst → bool
-
Returns
true
if this node is the first node in the parent list.no setter - isLast → bool
-
Returns
true
if this node is the last node in the parent list.no setter - length → int
-
Length of this node in characters.
no setter
-
list
→ LinkedList<
Node> ? -
The linked list containing this element.
no setterinherited
- mounted → bool
-
Returns
true
if this node is currently mounted, e.g. parent is notnull
.no setter - next → Node?
-
The successor of this element in its linked list.
no setterinherited
- offset → int
-
Offset in characters of this node relative to parent node.
no setter
-
parent
→ ContainerNode<
Node?> ? -
Current parent of this node. May be null if this node is not mounted.
no setter
- previous → Node?
-
The predecessor of this element in its linked list.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
containsOffset(
int offset) → bool -
Returns
true
if this node contains character at specifiedoffset
in the document. -
delete(
int index, int? length) → void -
Delete
length
characters of this node starting fromindex
. -
insert(
int index, String text, NotusStyle? style) → void -
Insert
text
at specified characterindex
with stylestyle
. -
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 nonexistent method or property is accessed.
inherited
-
optimize(
) → void - Optimize this node within parent.
-
retain(
int index, int? length, NotusStyle? style) → void -
Format
length
characters of this node starting fromindex
with specified stylestyle
. -
toDelta(
) → Delta - Returns Delta representation of this node.
-
toPlainText(
) → String - Returns plain-text representation of this node.
-
toString(
) → String -
A string representation of this object.
inherited
-
unlink(
) → void -
Unlink the element from its linked list.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited