Properties
TypeAssistant
#Gets the type assistant (if any) associated with the type constraint. More derived types that are stored in this tree may have more specific type assistants.
Methods
ConvertItems<Q>
#Tree<Q> ConvertItems<Q>(Func<object, Q> replaceItem, Pear<Q> nullReplacement, CancellationToken token)
Modify all items in this tree.
Parameters:
| replaceItem (Func<object, Q>) | Replacement method for non-null items. |
| nullReplacement (Pear<Q>) | Replacement pear for null values. If not provided, nulls are simply persisted. |
| token (CancellationToken) | Cancellation token. |
ConvertPears
#Modify all pears in this tree.
Parameters:
| replacePear (Func<IPear, IPear>) | Replacement method for non-null pears. |
| nullReplacement (IPear) | Replacement method for nulls. If not provided, nulls are simply persisted. |
| token (CancellationToken) | Cancellation token. |
ConvertPears<Q>
#Modify all pears in this tree.
Parameters:
| replacePear (Func<IPear, Pear<Q>>) | Replacement method for non-null items. |
| nullReplacement (Pear<Q>) | Replacement method for nulls. If not provided, nulls are simply persisted. |
| token (CancellationToken) | Cancellation token. |
Filter
#Apply a collection of rules to all the twigs and all the items in this tree.
Parameters:
| rules (IEnumerable<SiteRule>) | Rules to apply. |
Returns: A new tree with only the twigs and items that were valid under the given rules.
Filter
#Apply one or more rules to all the twigs and all the items in this tree.
Parameters:
| rules (params SiteRule[]) | Rules to apply. |
Returns: A new tree with only the twigs and items that were valid under the given rule.
Flip
#Flip the tree by exchanging the twig indices of all items with one of the path elements.
Parameters:
| elementIndex (int) | Path element to flip. |
| indexing (IndexModifier) | Indexing to apply to the indices. |
Returns: Flipped tree.
GetCoverage
#Gets the part of a tree that is implied by a specific coverage.
Parameters:
| coverage (Coverage) | Coverage. |
Returns: Part of the tree identified by the coverage, or null if the coverage doesn't intersect with the tree.
IsCoincidentWith
#Test whether a given coverage coincides with this tree.
Parameters:
| coverage (Coverage) | Coverage to test. |
Returns: True if the coverage is valid.
IsCoincidentWith
#Tests whether a given site (path+twig index) is part of this tree.
Parameters:
| site (Site) | Tree site. |
Returns: True if the site exists within the tree.
NullAt
#Gets whether a specific item is null or not.
NullAt
#Gets whether a specific item is null or not.
ReplacePath
#Replace one path with another. If the replace path already exists within the tree, the items will be appended to the existing twig.
Similarity
#Compares two data trees for similarity.
Parameters:
| tree (ITree) | Data tree to compare to. |
Returns: A TreeSimilarity type. This method never returns the PathsAndListsAndItems value.
Split
#Split this tree into a positive and a negative state by applying a collection of rules.
Parameters:
| rules (IEnumerable<SiteRule>) | Rules to apply. |
| positive (out ITree) | Tree containing all the twigs and items that are valid under the given rules. |
| negative (out ITree) | Tree containing all the twigs and items that are invalid under the given rules. |
Split
#Split this tree into a positive and a negative state by applying a specific rule.
ToString
#Format this tree using a specific formatting template.
Parameters:
| style (TwigFormatStyle) | Formatting style. |
Returns: String describing the tree.
TryConvert<TQ>
#Try and convert this tree into a tree of a specific type.
Returns: Tree of type TQ or null if no conversion could be found.
TryConvert<TQ>
#Try and convert this tree into a tree of a specific type.
Parameters:
| token (CancellationToken) | Cancellation token. |
| record (ConversionRecord) | If not null, conversion messages will be added to this record. |
Returns: Tree of type TQ or null if no conversion could be found.
TryConvert<TQ>
#Try and convert this tree into a tree of a specific type.
Parameters:
| token (CancellationToken) | Cancellation token. |
Returns: Tree of type TQ or null if no conversion could be found.
WithIncrementalPaths
#Simplify the numbering of paths by starting at zero and incrementing by one for each element in the sequence.
WithMetaData
#Merge all data from another tree.
Parameters:
| source (ITree) | Source of meta data. Source.Count must equal the local ImageCount and any twig in source which contains meta data must have the same length as the corresponding twig in this tree. |
| mergeBehaviour (MergeBehaviour) | Custom data merge behaviour. |
WithMetaData
#Assign meta data to all items in this tree.
WithoutPaths
#Remove all specified paths and corresponding twigs.
Parameters:
| paths (IEnumerable<Path>) | Paths to remove. |
Returns: Modified tree.
WithoutPaths
#Remove the specified paths and corresponding twigs from this tree.
Parameters:
| paths (params Path[]) | Paths to remove. |
Returns: Modified tree.
WithoutSites
#Remove all specified sites from the tree.
Parameters:
| sites (IEnumerable<Site>) | Sites to remove. |
Returns: Modified tree
WithoutSites
#Remove the specified sites from this tree.
Parameters:
| sites (params Site[]) | Loci to remove. |
Returns: Modified tree.
WithPathPrefix
#Prepend an integer to all paths in the tree.
Parameters:
| element (int) | Element to prepend. |
Returns: Modified tree.
WithPathPrefix
#Prepend an entire path to all existing paths in the tree.
Parameters:
| path (Path) | Path to prepend. |
Returns: Modified tree.
WithPaths
#Create a new tree with different paths but the same twigs.
Parameters:
| source (Paths) | Paths to adopt. |
Returns: Modified tree.
WithPathSuffix
#Append an integer to all paths in the tree.
Parameters:
| element (int) | Element to append. |
Returns: Modified tree.
WithPathSuffix
#Append an entire path to all existing paths in the tree.
Parameters:
| path (Path) | Path to append. |
Returns: Modified tree.
WithRenumberedPaths
#Renumber all paths in this tree in ascending order.
Parameters:
| start (int) | Starting number for first path. |
Returns: Modified tree.
WithRenumberedPaths
#Renumber all paths in this tree in ascending order.
WithReversedTwigs
#Reverse the order of all the items in the twigs of this tree.
Returns: Reversed tree.
WithSimplifiedPaths
#Perform a simplify operation on this tree.
Parameters:
| options (PathAlignment) | Simplify options |
Returns: Modified tree.
WithSite
#Replace a single pear in this tree.
WithTopology
#Copy the topology of another tree while keeping the data from this tree. For a successful topology copy, the source and the target trees must have the same number of items.
Parameters:
| source (ITree) | Source tree to copy topology from. |
Returns: modified tree.
WithTrimmedPaths
#Trim the tree by removing the last element in each path and merging twigs together.
Returns: Modified tree.