Coverage
ReferencesA coverage specifies items, twigs or even entire trees using two integers. Coverages ignore actual paths, opting instead to identify elements using indices alone.
Properties
Methods
CreateItemCoverage
#Create coverage for a specific item.
CreateTwigCoverage
#Create coverage for a specific twig.
Parameters:
| twigIndex (int) | Index of twig within tree. |
Returns: Coverage.
IncrementItem
#Move the coverage to the next item. This method can only be called if the coverage access is Access.Item.
Returns: New coverage.
IncrementTwig
#Move the coverage to the next twig. This method can only be called if the coverage access is not Access.Tree.
Returns: New coverage.
IsValidCoverage
#Test whether a specific coverage validly applies to a tree.
IsValidCoverage
#Test whether the given coverages correctly identify specific elements of a an array of trees.
Parameters:
| coverages (Coverage[]) | |
| trees (ITree[]) |
Slice
#Create a new tree based on this coverage of an existing tree.
Parameters:
| tree (ITree) | Tree to slice. |
| graftItem (bool) | If true, and the Access of this coverage is Access.Item, the item index will be appended to the returned tree. |
TryIncrementItem
#Try and increment a coverage to the next item index.
TryIncrementItems
#Try and increment all coverages whose Access is set to Access.Item to the next item index.
Parameters:
| coverages (Coverage[]) | Coverages to increment. |
| trees (ITree[]) | Tree constraints. |
| modified (bool[] = null) | Optional boolean array for individual coverage modifications. Must be of the same size as the coverages and trees array and should contain only false values. |
Returns: True if at least one coverage in the array was successfully incremented.
TryIncrementTwig
#Try and increment a coverage to the next twig index.
TryIncrementTwigs
#Try and increment all coverages whose Access is set to either Access.Item or Access.Twig to the next twig index.
Parameters:
| coverages (Coverage[]) | Coverages to increment. |
| trees (ITree[]) | Tree constraints. |
| modified (bool[] = null) | Optional boolean array for individual coverage modifications. Must be of the same size as the coverages and trees array and should contain only false values. |
Returns: True if at least one coverage in the array was successfully incremented.