Class HierarchyBean<T>

  • Type Parameters:
    T - type of nodes in hierarchy
    Direct Known Subclasses:
    ProjectHierarchyBean

    public class HierarchyBean<T>
    extends Object
    Bean representing node of tree-like hierarchy and assumed to be used to display such hierarchies. List of these beans represents hierarchy tree - each bean knows its depth and can be placed in UI with offset depending on this depth.
    Since:
    9.0
    Author:
    Dmitry.Treskunov
    • Field Detail

      • myDepth

        protected int myDepth
    • Constructor Detail

      • HierarchyBean

        protected HierarchyBean​(T node)
    • Method Detail

      • getNode

        public T getNode()
      • getDepth

        public int getDepth()
      • getLimitedDepth

        public int getLimitedDepth()
      • getLimitedDepth

        public static int getLimitedDepth​(int depth)
      • setDepth

        protected void setDepth​(int depth)
      • buildFor

        @NotNull
        public static <B extends HierarchyBean<I>,​I> List<B> buildFor​(@NotNull
                                                                            List<I> items,
                                                                            @NotNull
                                                                            HierarchyBean.BeanCreator<I,​B> creator,
                                                                            boolean alreadySorted,
                                                                            @NotNull
                                                                            TreeHierarchyComparator<I> comparator)
        Create list of HierarchyBean. Such list represents tree-like hierarchy: - items are ordered in the way allowing to display them on UI using foreach loop (parents precede children) - each item knows its depths, that can be used as offset to display this item.