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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiselectDecisionItem(String label, String value)Create a new decision item with label and value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MultiselectDecisionItem>getChildren()Get children for this item.StringgetDisplayLabel()Get display label for this item.StringgetLabel()Get label for this item.MultiselectDecisionItemgetParent()Get parent for this item.StringgetValue()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.voidsetLabel(String label)Set label for this item.voidsetParent(MultiselectDecisionItem parent)Set parent for this item.voidsetValue(String value)Set value for this item.StringtoString()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.
-
-
-
Method Detail
-
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
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
-
-