Interface ModelFilterTreesContextReadWrite
- All Superinterfaces:
ModelFilterTreesContextReadOnly
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static final class
Represents an in-memory tree.Nested classes/interfaces inherited from interface ModelFilterTreesContextReadOnly
ModelFilterTreesContextReadOnly.FilterTree, ModelFilterTreesContextReadOnly.FilterTreeNode
-
Method Summary
Modifier and TypeMethodDescriptionaddTree
(String name, ModelFilterTreesContextReadWrite.NodeSpec root) Add a tree that will be owned by this model.
-
Method Details
-
tree
- Specified by:
tree
in interfaceModelFilterTreesContextReadOnly
- Parameters:
name
- The name of theModelFilterTreesContextReadWrite.MutableFilterTree
owned by this model- Returns:
- A
ModelFilterTreesContextReadWrite.MutableFilterTree
ornull
if it doesn't exist - Since:
- 9.0 Hurricane
-
addTree
ModelFilterTreesContextReadWrite.MutableFilterTree addTree(String name, ModelFilterTreesContextReadWrite.NodeSpec root) Add a tree that will be owned by this model.If the tree already exists, it is deleted and replaced by this new tree.
Here is an example of a tree representation:
def myTree = model.addTree( "Segments", new NodeSpec( name: "Segments", label: "the root", children: [ new NodeSpec( name: "S1", label: "avg=0.189", filter: Filter.equal("CategoryA", "foo"), filterDescription: "CategoryA == foo" ), new NodeSpec( name: "S2", label: "avg=0.345", filter: Filter.lessOrEqual("CategoryA", "bar"), filterDescription: "CategoryA <= bar" ) ] ) )
- Parameters:
name
- The name of the new tree, must be unique per modelroot
- The representation of the tree to add- Returns:
- the new
ModelFilterTreesContextReadWrite.MutableFilterTree
- Since:
- 9.0 Hurricane
-