Subtree#
The scope of a scoped run. Set it as subtree in SolveOptions or PreviewOptions to reschedule one task's branch instead of the whole project. Create it with new Subtree(task) and chain withInclusive(false) to follow outgoing links only.
Declaration#
;
Constructors#
Subtree(Id)#
public
Creates a scope rooted at task with inclusive = true. Subtree has no parameterless constructor.
Parameters
| Name | Type | Description |
|---|---|---|
task |
Id |
Root task ID, for example Id.str("a") or Id.num(1) |
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
task |
Id |
set by the constructor | Root task of the scope. The scope covers this task, its ancestors and descendants, and every task reached from them through outgoing links, transitively. Each task reached this way brings its own ancestors and descendants. |
inclusive |
boolean |
true |
true also follows incoming links, so predecessors and their branches join the scope. false follows outgoing links only. The root is in scope either way. |
Both fields are public and mutable.
Methods#
withTask#
public Subtree
Sets task and returns this instance for chaining.
withInclusive#
public Subtree
Sets inclusive and returns this instance for chaining.
deepClone#
public Subtree
Returns a new Subtree with the same task and inclusive. Implements DeepCloneable.
copy#
public Subtree
Returns a shallow copy. Id is immutable, so the copy is independent of the original.
equals, hashCode, toString#
public boolean
public int
public String
Value semantics, inherited from ValueRecord. Two scopes are equal when task and inclusive are equal, and hashCode follows the same fields. toString returns a readable form for logging, such as Subtree{task=a, inclusive=true}.
Errors#
If task is unknown or unscheduled, the call that receives the options throws InputException (unchecked) with kind = InputErrorKind.VALIDATION and path = "subtree.task".
Example#
Commit an edit to task a, then reschedule only a and the tasks linked downstream of it.
;
;
Related#
SolveOptions- carries it for solve and schedulePreviewOptions- carries it for preview- Reschedule a branch - solving and previewing one branch
- Scheduling a project - where the scope fits among the options