ZipperLocation<ZR, ZI extends ZR, ZS extends ZR> class

The main driver of our implementation We require 3 type parameters to handle the lack of algebraic data types in Dart To use this Zipper you need to define three classes ZR: an abstract root class that both ZI and ZS extend ZI: the item class, leaf nodes of the zipper ZS: the section class, branch classes containing children nodes

Annotations
  • @immutable

Constructors

ZipperLocation({required SectionP sectionP, required GetChildren<ZR, ZS> getChildren, required MakeSection<ZR, ZS> makeSection, required dynamic node, required Path<ZR> path})
ZipperLocation.root({required SectionP sectionP, required GetChildren<ZR, ZS> getChildren, required MakeSection<ZR, ZS> makeSection, required dynamic node})

Properties

getChildren GetChildren<ZR, ZS>
final
hashCode int
The hash code for this object.
no setterinherited
makeSection MakeSection<ZR, ZS>
final
node → dynamic
final
path Path<ZR>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sectionP SectionP
final

Methods

delete() ZipperLocation<ZR, ZI, ZS>
Remove the current node from the zipper We first try to move to the right then to the left, and otherwise up
goDown() ZipperLocation<ZR, ZI, ZS>
Move down the tree
goLeft() ZipperLocation<ZR, ZI, ZS>
Move to the sibling on the left
goRight() ZipperLocation<ZR, ZI, ZS>
Move to the sibling on the right
goUp() ZipperLocation<ZR, ZI, ZS>
Move to parent
insertDown(ZR d) ZipperLocation<ZR, ZI, ZS>
Insert down
insertLeft(ZR r) ZipperLocation<ZR, ZI, ZS>
Insert new node to the left
insertRight(ZR r) ZipperLocation<ZR, ZI, ZS>
Insert new node to the right
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replace(ZR rep) ZipperLocation<ZR, ZI, ZS>
Replace current node
toString() String
A string representation of this object.
inherited
update({required dynamic node, required Path<ZR> path}) ZipperLocation<ZR, ZI, ZS>
A helper method to copy the definition methods

Operators

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