Java Code Examples for org.dmg.pmml.Visitor#visit()

The following examples show how to use org.dmg.pmml.Visitor#visit() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaModel.java    From jpmml-evaluator with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public VisitorAction accept(Visitor visitor){
	VisitorAction status = visitor.visit(this);

	if(status == VisitorAction.CONTINUE){
		visitor.pushParent(this);

		status = PMMLObject.traverse(visitor, getMiningSchema(), getOutput(), getModelStats(), getModelExplanation(), getTargets(), getLocalTransformations(), getModelVerification());

		visitor.popParent();
	} // End if

	if(status == VisitorAction.TERMINATE){
		return VisitorAction.TERMINATE;
	}

	return VisitorAction.CONTINUE;
}
 
Example 2
Source File: FunctionExpression.java    From jpmml-r with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public VisitorAction accept(Visitor visitor){
	VisitorAction status = visitor.visit(this);

	if(status == VisitorAction.CONTINUE){
		visitor.pushParent(this);

		if(hasArguments()){
			List<Argument> arguments = getArguments();

			for(Argument argument : arguments){
				status = PMMLObject.traverse(visitor, argument.getExpression());

				if(status != VisitorAction.CONTINUE){
					break;
				}
			}
		}

		visitor.popParent();
	} // End if

	if(status == VisitorAction.TERMINATE){
		return VisitorAction.TERMINATE;
	}

	return VisitorAction.CONTINUE;
}
 
Example 3
Source File: SimpleNode.java    From jpmml-model with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@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());
		} // End if

		if(status == VisitorAction.CONTINUE){
			status = PMMLObject.traverse(visitor, getPredicate(), getPartition());
		} // End if

		if(status == VisitorAction.CONTINUE && hasScoreDistributions()){
			status = PMMLObject.traverse(visitor, getScoreDistributions());
		} // End if

		if(status == VisitorAction.CONTINUE && hasNodes()){
			status = PMMLObject.traverse(visitor, getNodes());
		} // End if

		if(status == VisitorAction.CONTINUE){
			status = PMMLObject.traverse(visitor, getEmbeddedModel());
		}

		visitor.popParent();
	} // End if

	if(status == VisitorAction.TERMINATE){
		return VisitorAction.TERMINATE;
	}

	return VisitorAction.CONTINUE;
}
 
Example 4
Source File: JavaExpression.java    From jpmml-evaluator with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public VisitorAction accept(Visitor visitor){
	VisitorAction status = visitor.visit(this);

	if(status == VisitorAction.CONTINUE){
		visitor.pushParent(this);
		visitor.popParent();
	} // End if

	if(status == VisitorAction.TERMINATE){
		return VisitorAction.TERMINATE;
	}

	return VisitorAction.CONTINUE;
}
 
Example 5
Source File: JavaPredicate.java    From jpmml-evaluator with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public VisitorAction accept(Visitor visitor){
	VisitorAction status = visitor.visit(this);

	if(status == VisitorAction.CONTINUE){
		visitor.pushParent(this);
		visitor.popParent();
	} // End if

	if(status == VisitorAction.TERMINATE){
		return VisitorAction.TERMINATE;
	}

	return VisitorAction.CONTINUE;
}