Class MultiselectDecisionItem

java.lang.Object
de.westemeyer.plugins.multiselect.MultiselectDecisionItem
All Implemented Interfaces:
Serializable

public class MultiselectDecisionItem extends Object implements Serializable
Multiselect decision item will be the individual select box row to use in decision tree.
See Also:
  • Constructor Details

    • MultiselectDecisionItem

      @DataBoundConstructor public MultiselectDecisionItem(MultiselectDecisionItem parent, String label, String value)
      Create a new decision item with label and value.
      Parameters:
      parent - parent item to traverse tree backwards
      label - label for display in selection list
      value - value for use in variable
  • Method Details

    • visitSubTree

      public void visitSubTree(MultiselectDecisionItemVisitor visitor, Queue<MultiselectVariableDescriptor> columns) throws Exception
      Visitor pattern implementation to walk through the tree collecting information.
      Parameters:
      visitor - visitor object or lambda collecting information
      columns - column descriptions to go along with the items
      Throws:
      Exception - if an error occurs in visitor
    • visitSubTree

      public static void visitSubTree(MultiselectDecisionItemVisitor visitor, List<MultiselectDecisionItem> items, Queue<MultiselectVariableDescriptor> columns) throws Exception
      Static visitor pattern implementation to walk through the tree collecting information.
      Parameters:
      visitor - visitor object or lambda collecting information
      items - item list (column entries) to iterate
      columns - column descriptions to go along with the items
      Throws:
      Exception - if an error occurs in visitor
    • visitSelectedItems

      public void visitSelectedItems(MultiselectDecisionItemVisitor visitor, Queue<MultiselectVariableDescriptor> columns, Queue<Integer> itemPath)
      Visitor pattern implementation to walk through the tree collecting information. Select the column items by their column index (no iteration involved).
      Parameters:
      visitor - visitor object or lambda collecting information
      columns - column descriptions to go along with the items
      itemPath - indices of items in columns to select and walk through
    • visitSelectedItems

      public static void visitSelectedItems(MultiselectDecisionItemVisitor visitor, List<MultiselectDecisionItem> items, Queue<MultiselectVariableDescriptor> columns, Queue<Integer> itemPath)
      Static visitor pattern implementation to walk through the tree collecting information. Select the column items by their column index (no iteration involved).
      Parameters:
      visitor - visitor object or lambda collecting information
      items - item list (column entries) to iterate
      columns - column descriptions to go along with the items
      itemPath - indices of items in columns to select and walk through
    • getLabel

      public String getLabel()
      Get label for this item.
      Returns:
      label for this item
    • setLabel

      @DataBoundSetter public void setLabel(String label)
      Set label for this item.
      Parameters:
      label - the new label
    • getValue

      public String getValue()
      Get value for this item.
      Returns:
      value for this item
    • setValue

      @DataBoundSetter public void setValue(String value)
      Set value for this item.
      Parameters:
      value - value for this item
    • getChildren

      public List<MultiselectDecisionItem> getChildren()
      Get children for this item.
      Returns:
      children for this item
    • setChildren

      @DataBoundSetter public void setChildren(List<MultiselectDecisionItem> children)
      Set children for this item.
      Parameters:
      children - children for this item
    • isRoot

      public boolean isRoot()
      Whether the item is at the root of the tree.
      Returns:
      whether the item is the root item
    • isLeaf

      public boolean isLeaf()
      Whether the item is a leaf item at the rightmost column
      Returns:
      whether the item is a leaf item at the rightmost column
    • getParent

      public MultiselectDecisionItem getParent()
      Get parent for this item.
      Returns:
      parent for this item
    • setParent

      public void setParent(MultiselectDecisionItem parent)
      Set parent for this item.
      Parameters:
      parent - the new parent object
    • getDisplayLabel

      public String getDisplayLabel()
      Get display label for this item.
      Returns:
      display label for this item
    • toString

      public String toString()
      Overrides:
      toString in class Object