Class MultiselectDecisionItem
java.lang.Object
de.westemeyer.plugins.multiselect.MultiselectDecisionItem
- All Implemented Interfaces:
Serializable
Multiselect decision item will be the individual select box row to use in decision tree.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMultiselectDecisionItem(MultiselectDecisionItem parent, String label, String value) Create a new decision item with label and value. -
Method Summary
Modifier and TypeMethodDescriptionGet children for this item.Get display label for this item.getLabel()Get label for this item.Get parent for this item.getValue()Get value for this item.booleanisLeaf()Whether the item is a leaf item at the rightmost columnbooleanisRoot()Whether the item is at the root of the tree.voidsetChildren(List<MultiselectDecisionItem> children) Set children for this item.voidSet label for this item.voidsetParent(MultiselectDecisionItem parent) Set parent for this item.voidSet value for this item.toString()static voidvisitSelectedItems(MultiselectDecisionItemVisitor visitor, List<MultiselectDecisionItem> items, Queue<MultiselectVariableDescriptor> columns, Queue<Integer> itemPath) Static visitor pattern implementation to walk through the tree collecting information.voidvisitSelectedItems(MultiselectDecisionItemVisitor visitor, Queue<MultiselectVariableDescriptor> columns, Queue<Integer> itemPath) Visitor pattern implementation to walk through the tree collecting information.static voidvisitSubTree(MultiselectDecisionItemVisitor visitor, List<MultiselectDecisionItem> items, Queue<MultiselectVariableDescriptor> columns) Static visitor pattern implementation to walk through the tree collecting information.voidvisitSubTree(MultiselectDecisionItemVisitor visitor, Queue<MultiselectVariableDescriptor> columns) Visitor pattern implementation to walk through the tree collecting information.
-
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 backwardslabel- label for display in selection listvalue- 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 informationcolumns- 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 informationitems- item list (column entries) to iteratecolumns- 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 informationcolumns- column descriptions to go along with the itemsitemPath- 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 informationitems- item list (column entries) to iteratecolumns- column descriptions to go along with the itemsitemPath- indices of items in columns to select and walk through
-
getLabel
Get label for this item.- Returns:
- label for this item
-
setLabel
Set label for this item.- Parameters:
label- the new label
-
getValue
Get value for this item.- Returns:
- value for this item
-
setValue
Set value for this item.- Parameters:
value- value for this item
-
getChildren
Get children for this item.- Returns:
- children for this item
-
setChildren
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
Get parent for this item.- Returns:
- parent for this item
-
setParent
Set parent for this item.- Parameters:
parent- the new parent object
-
getDisplayLabel
Get display label for this item.- Returns:
- display label for this item
-
toString
-