Class BasicTree<DATATYPE,​ITEMTYPE extends ITreeItem<DATATYPE,​ITEMTYPE>>

  • Type Parameters:
    DATATYPE - tree item value type
    ITEMTYPE - tree item implementation type
    All Implemented Interfaces:
    com.helger.commons.hierarchy.IHasChildren<ITEMTYPE>, IBasicTree<DATATYPE,​ITEMTYPE>, ITree<DATATYPE,​ITEMTYPE>
    Direct Known Subclasses:
    DefaultTree

    @NotThreadSafe
    public class BasicTree<DATATYPE,​ITEMTYPE extends ITreeItem<DATATYPE,​ITEMTYPE>>
    extends Object
    implements ITree<DATATYPE,​ITEMTYPE>
    Root class for a simple tree. The elements of the tree are not sorted by any means.
    Author:
    Philip Helger
    • Method Detail

      • hasChildren

        public final boolean hasChildren()
        Specified by:
        hasChildren in interface com.helger.commons.hierarchy.IHasChildren<DATATYPE>
      • getChildCount

        @Nonnegative
        public final int getChildCount()
        Specified by:
        getChildCount in interface com.helger.commons.hierarchy.IHasChildren<DATATYPE>
      • getAllChildren

        @Nonnull
        @ReturnsMutableCopy
        public final com.helger.commons.collection.impl.ICommonsCollection<ITEMTYPE> getAllChildren()
        Specified by:
        getAllChildren in interface com.helger.commons.hierarchy.IHasChildren<DATATYPE>
      • getChildren

        @Nonnull
        public final com.helger.commons.collection.impl.ICommonsIterable<ITEMTYPE> getChildren()
        Specified by:
        getChildren in interface com.helger.commons.hierarchy.IHasChildren<DATATYPE>
      • forAllChildren

        public final void forAllChildren​(@Nonnull
                                         Consumer<? super ITEMTYPE> aConsumer)
        Specified by:
        forAllChildren in interface com.helger.commons.hierarchy.IHasChildren<DATATYPE>
      • forAllChildrenBreakable

        @Nonnull
        public final com.helger.commons.state.EContinue forAllChildrenBreakable​(@Nonnull
                                                                                Function<? super ITEMTYPE,​com.helger.commons.state.EContinue> aConsumer)
        Specified by:
        forAllChildrenBreakable in interface com.helger.commons.hierarchy.IHasChildren<DATATYPE>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object