ContainerNode<T extends Node> class abstract

Container node can accommodate other nodes.

Delegates insert, retain and delete operations to children nodes. For each operation container looks for a child at specified index position and forwards operation to that child.

Most of the operation handling logic is implemented by LineNode and TextNode.

Inheritance

Constructors

ContainerNode()

Properties

childCount int
Returns total number of child nodes in this container.
no setter
children LinkedList<Node>
List of children.
no setter
defaultChild → T
Returns an instance of default child for this container node.
no setter
documentOffset int
Offset in characters of this node in the document.
no setterinherited
first Node
Returns the first child Node.
no setter
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if this container has no child nodes.
no setter
isFirst bool
Returns true if this node is the first node in the parent list.
no setterinherited
isLast bool
Returns true if this node is the last node in the parent list.
no setterinherited
isNotEmpty bool
Returns true if this container has at least 1 child.
no setter
last Node
Returns the last child Node.
no setter
length int
Content length of this node's children. To get number of children in this node use childCount.
no setteroverride
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 not null.
no setterinherited
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 setterinherited
parent ContainerNode<Node>?
Current parent of this node. May be null if this node is not mounted.
no setterinherited
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

add(T node) → void
Adds node to the end of this container children list.
addFirst(T node) → void
Adds node to the beginning of this container children list.
containsOffset(int offset) bool
Returns true if this node contains character at specified offset in the document.
inherited
delete(int index, int? length) → void
Delete length characters of this node starting from index.
override
insert(int index, Object data, NotusStyle? style) → void
Insert data at specified character index with style style.
override
insertAfter(Node entry) → void
Insert an element after this element in this element's linked list.
inherited
insertBefore(Node entry) → void
Insert an element before this element in this element's linked list.
inherited
lookup(int offset, {bool inclusive = false}) LookupResult
Looks up a child Node at specified character offset in this container.
moveChildren(ContainerNode<Node>? newParent) → void
Moves children of this node to newParent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optimize() → void
Optimize this node within parent.
inherited
remove(T node) → void
Removes node from this container.
retain(int index, int length, NotusStyle attributes) → void
Format length characters of this node starting from index with specified style style.
override
toDelta() → Delta
Returns Delta representation of this node.
inherited
toPlainText() String
Returns plain-text representation of this node.
override
toString() String
A string representation of this object.
override
Unlink the element from its linked list.
inherited

Operators

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