Class AbstractTreeModel<N,T extends AbstractTreeModel<N,T>>

java.lang.Object
overit.geocallapp.utilities.treemodel.AbstractTreeModel<N,T>
Type Parameters:
N - the number type
T - the generic type
Direct Known Subclasses:
TreeModel, UXTreeModel

public abstract class AbstractTreeModel<N,T extends AbstractTreeModel<N,T>> extends Object
The Class that defines the abstract tree model.
  • Constructor Details

    • AbstractTreeModel

      public AbstractTreeModel()
  • Method Details

    • getNode

      public N getNode()
    • setNode

      public void setNode(N node)
    • hasNode

      public boolean hasNode()
    • getParent

      public T getParent()
    • setParent

      protected void setParent(T parent)
    • getChildren

      public List<T> getChildren()
    • getChildrenByNodeFilter

      public List<T> getChildrenByNodeFilter(Predicate<N> filter)
    • isChild

      public boolean isChild(T child)
    • addChild

      public void addChild(T child)
    • addChildren

      public void addChildren(List<T> children)
    • addChild

      public void addChild(T child, int position)
    • addSiblingBefore

      public void addSiblingBefore(T sibling)
    • addSiblingAfter

      public void addSiblingAfter(T sibling)
    • getChildIndex

      public int getChildIndex(T child)
    • swapChild

      public void swapChild(int currentChildIndex, int newChildIndex)
    • removeChild

      public void removeChild(T child)
    • removeChildren

      public void removeChildren(List<T> children)
    • removeFromParent

      public void removeFromParent()
    • isRoot

      public boolean isRoot()
    • isLeaf

      public boolean isLeaf()
    • isAncestorOf

      public boolean isAncestorOf(T treeModel, boolean itselfAsAncestor)
    • isDescendantOf

      public boolean isDescendantOf(T treeModel, boolean itselfAsDescendant)
    • isFirstChild

      public boolean isFirstChild()
    • isLastChild

      public boolean isLastChild()
    • getRoot

      public T getRoot()
    • getDepth

      public int getDepth()
    • bfsStream

      public Stream<T> bfsStream()
    • dfsStream

      public Stream<T> dfsStream()
    • ancestorsStream

      public Stream<T> ancestorsStream()
    • ascendingStream

      public Stream<T> ascendingStream()
    • getDfsNodes

      public List<N> getDfsNodes()
    • getNodesMap

      public <K> Map<K,N> getNodesMap(Function<N,K> keyFunction)
    • findByNodeFilter

      public T findByNodeFilter(Predicate<N> filter)
    • findNodesByFilter

      public List<T> findNodesByFilter(Predicate<N> filter)
    • findNodeByNodeFilter

      public N findNodeByNodeFilter(Predicate<N> filter)