subtree is a more generic version of visitParentChildrenUpwards(.) that allows you to effectively.Parameters: filter - filter that returns a truthy value if a row with given ID should be present in the resulting forest (as defined in La.accepts(T)) indicates that the row passes the filter. However, unlike filterSoft(.) it achieves that by not including those matching rows The resulting forest contains only rows that pass the condition, but possibly not all of them. filterHardest this forest by excluding rows that do not pass the filter condition.Īll sub-rows of rows that have not passed the filter are also removed.Null means "no filtering" - this forest is returned Returns: a filtered forest (or this forest if all rows satisfy the filter) Note: if you need to filter by hierarchy-based or JQL constraints, see StructureQuery. Unlike filter(.) method, this method preserves the topology of the original forest -Īll rows in the resulting forest have the same root path as they do in the original forest. Resulting forest contains sub-sequence of the original forest with rows having the same parents and depths. That contain sub-rows that have passed the filter are also preserved.
![the forest api the forest api](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/50001707052/original/VSH27Tf6zyLGsecmTs-c2APytOaKm-7Yyg.png)
![the forest api the forest api](https://medias.apidura.com/2021/07/Apidura-New-Forest-2984-Edit-1.jpg)
This happens when a row that has sub-rows is filtered Have a different parent in the resulting forest. The topology of the resulting forest may differ from the original forest - that is, a row may Resulting forest contains only the rows that pass the condition (all of them). Author: Igor Seredaįilters this forest by hiding rows that do not pass the filter condition. This row id is reservedĪnd cannot be used for normal rows. The super-root row ( SuperRootRow) has a predefined row ID of -1. The result of creating and using a forest that violates these invariants is undefined. The invariants are not checked and assumed to hold true when running with assertions disabled. When Java assertions are enabled, these invariants are checked all the time. Row ID may not be 0 - this value represents "missing" or "no value" in various methods of this interface.If a row is present in the forest at index N, it must not be present at any other index.The depth of the following element must be within range. Given that the depth of an element is D,.The depth of the first element in the forest must be 0.You don't violate those invariants when creating new forest instances: Additionally,Ī row may appear no more than once in the forest. Invariants about the depth that must hold true, otherwise the data does not make sense. (A, 0), (A1, 1), (A2, 1), (B, 0), (B1, 1), (B1X, 2)īecause depth associated with a row is an integer number, there are certain Is represented in the forest as the following sequence: Is identified by the position in the sequence and the associated depth. To get the details of a specific row (such as issue ID), you need to obtainįorest of rows is represented as a sequence of pairs (long row, int depth). There are also a number of utility methods that allow searching and browsing the That is, you can read row IDs and depths given that you know the index of the pair in the (the hierarchy is a sequence of tree structures, a forest).
![the forest api the forest api](https://www.assetservicingtimes.com/assetservicesnews/images/MondayJune720211623059630.jpg)
Forest interface provides indexed access to a data structure that stores row hierarchy