public ComplexNode addNodes(org.dmg.pmml.tree.Node... nodes) { getNodes().addAll(Arrays.asList(nodes)); return this; }
public ComplexNode addNodes(org.dmg.pmml.tree.Node... nodes) { getNodes().addAll(Arrays.asList(nodes)); return this; }
static public ComplexNode toComplexNode(Node node){ ComplexNode result = new ComplexNode() .setId(node.getId()) .setScore(node.getScore()) .setRecordCount(node.getRecordCount()) .setDefaultChild(node.getDefaultChild()) .setPredicate(node.getPredicate()); if(node.hasNodes()){ (result.getNodes()).addAll(node.getNodes()); } // End if if(node.hasScoreDistributions()){ (result.getScoreDistributions()).addAll(node.getScoreDistributions()); } return result; } }
(value.getNodes()).addAll(node.getNodes());
(value.getNodes()).addAll(node.getNodes());
@Override public Node unmarshal(ComplexNode value){ if(value.getRecordCount() != null){ return value; } // End if if(value.hasExtensions() || (value.getPartition() != null) || value.hasScoreDistributions() || (value.getEmbeddedModel() != null)){ return value; } Node node; if(value.hasNodes()){ node = new BranchNode() .setId(value.getId()) .setDefaultChild(value.getDefaultChild()); (node.getNodes()).addAll(value.getNodes()); } else { node = new LeafNode() .setId(value.getId()); } node .setScore(value.getScore()) .setPredicate(value.getPredicate()); return node; }
@Override public Node unmarshal(ComplexNode value){ if(value.getRecordCount() != null){ return value; } // End if if(value.hasExtensions() || (value.getPartition() != null) || value.hasScoreDistributions() || (value.getEmbeddedModel() != null)){ return value; } Node node; if(value.hasNodes()){ node = new BranchNode() .setId(value.getId()) .setDefaultChild(value.getDefaultChild()); (node.getNodes()).addAll(value.getNodes()); } else { node = new LeafNode() .setId(value.getId()); } node .setScore(value.getScore()) .setPredicate(value.getPredicate()); return node; }
@Override public VisitorAction accept(Visitor visitor) { VisitorAction status = visitor.visit(this); if (status == VisitorAction.CONTINUE) { visitor.pushParent(this); if ((status == VisitorAction.CONTINUE)&&hasExtensions()) { status = PMMLObject.traverse(visitor, getExtensions()); } if (status == VisitorAction.CONTINUE) { status = PMMLObject.traverse(visitor, getPredicate(), getPartition()); } if ((status == VisitorAction.CONTINUE)&&hasScoreDistributions()) { status = PMMLObject.traverse(visitor, getScoreDistributions()); } if ((status == VisitorAction.CONTINUE)&&hasNodes()) { status = PMMLObject.traverse(visitor, getNodes()); } if (status == VisitorAction.CONTINUE) { status = PMMLObject.traverse(visitor, getEmbeddedModel()); } visitor.popParent(); } if (status == VisitorAction.TERMINATE) { return VisitorAction.TERMINATE; } return VisitorAction.CONTINUE; }
@Override public VisitorAction accept(Visitor visitor) { VisitorAction status = visitor.visit(this); if (status == VisitorAction.CONTINUE) { visitor.pushParent(this); if ((status == VisitorAction.CONTINUE)&&hasExtensions()) { status = PMMLObject.traverse(visitor, getExtensions()); } if (status == VisitorAction.CONTINUE) { status = PMMLObject.traverse(visitor, getPredicate(), getPartition()); } if ((status == VisitorAction.CONTINUE)&&hasScoreDistributions()) { status = PMMLObject.traverse(visitor, getScoreDistributions()); } if ((status == VisitorAction.CONTINUE)&&hasNodes()) { status = PMMLObject.traverse(visitor, getNodes()); } if (status == VisitorAction.CONTINUE) { status = PMMLObject.traverse(visitor, getEmbeddedModel()); } visitor.popParent(); } if (status == VisitorAction.TERMINATE) { return VisitorAction.TERMINATE; } return VisitorAction.CONTINUE; }