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.String
getDisplayLabel()
Get display label for this item.String
getLabel()
Get label for this item.MultiselectDecisionItem
getParent()
Get parent for this item.String
getValue()
Get value for this item.boolean
isLeaf()
Whether the item is a leaf item at the rightmost columnboolean
isRoot()
Whether the item is at the root of the tree.void
setChildren(List<MultiselectDecisionItem> children)
Set children for this item.void
setLabel(String label)
Set label for this item.void
setParent(MultiselectDecisionItem parent)
Set parent for this item.void
setValue(String value)
Set value for this item.String
toString()
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.void
visitSelectedItems(MultiselectDecisionItemVisitor visitor, Queue<MultiselectVariableDescriptor> columns, Queue<Integer> itemPath)
Visitor pattern implementation to walk through the tree collecting information.static void
visitSubTree(MultiselectDecisionItemVisitor visitor, List<MultiselectDecisionItem> items, Queue<MultiselectVariableDescriptor> columns)
Static visitor pattern implementation to walk through the tree collecting information.void
visitSubTree(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
-
-