Package org.iam.model

Class LabelTree<T>

java.lang.Object
org.iam.model.LabelTree<T>
Type Parameters:
T - the type of the nodes in the label tree

public class LabelTree<T> extends Object
LabelTree represents a tree structure where each node has a set of children.

Provides methods to find the maximal children of each node, where a maximal child is not contained by any other child of the same parent.

Since:
2025-02-28
Author:
  • Constructor Details

    • LabelTree

      public LabelTree(HashMap<T,HashSet<T>> nodeToChildren)
      Constructs a LabelTree with the given mapping of nodes to their children.
      Parameters:
      nodeToChildren - map from node to its children
  • Method Details

    • getNodeToMaximumChildren

      public HashMap<T,HashSet<T>> getNodeToMaximumChildren()
      Returns a map from each node to its set of maximal children.
      Returns:
      map from node to set of maximal children
    • getMaximumChildrens

      public HashSet<T> getMaximumChildrens(T nodeName)
      Finds the set of maximal children for a given node. A child is maximal if it is not contained by any other child of the same parent.
      Parameters:
      nodeName - the node for which to find maximal children
      Returns:
      set of maximal children