TreeOptions class final

The settings that shape a DirectoryTree: how paths are parsed, which nodes are top level, and how siblings are ordered.

Options are part of a tree's value: two trees are equal only when their options are equal. Every field has a default, so const TreeOptions() is a case-sensitive tree with TreeRoots.minimal roots and TreeOrder.directoriesFirst ordering.

TreeOptions is not generic on purpose. A generic options class would put the data type in the comparator's parameter types, and reading options.order through a DirectoryTree<Object?> reference would then throw at runtime. Typed comparators go through TreeOrder.by instead.

Annotations

Constructors

TreeOptions({PathPolicy paths = const PathPolicy(), TreeRoots roots = const TreeRoots.minimal(), NodeComparator order = TreeOrder.directoriesFirst})
Creates options; every argument has a default.
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
order → NodeComparator
How siblings (and top-level nodes) are ordered.
final
paths → PathPolicy
How raw entry paths are parsed and which spellings are the same node.
final
roots → TreeRoots
How the top-level nodes are chosen. Defaults to TreeRoots.minimal.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({PathPolicy? paths, TreeRoots? roots, NodeComparator? order}) → TreeOptions
Returns a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
Whether other is a TreeOptions with equal paths, roots, and order (functions compare by identity).
override