Search in sources :

Example 1 with False

use of org.dmg.pmml.FalseDocument.False in project knime-core by knime.

the class LiteralConditionParser method parseCondition.

/**
 * {@inheritDoc}
 */
@Override
public TreeNodeCondition parseCondition(final Node node) {
    CompoundPredicate compound = node.getCompoundPredicate();
    if (compound != null) {
        return handleCompoundPredicate(compound);
    }
    SimplePredicate simplePred = node.getSimplePredicate();
    if (simplePred != null) {
        return handleSimplePredicate(simplePred, false);
    }
    SimpleSetPredicate simpleSetPred = node.getSimpleSetPredicate();
    if (simpleSetPred != null) {
        return handleSimpleSetPredicate(simpleSetPred, false);
    }
    True truePred = node.getTrue();
    if (truePred != null) {
        return TreeNodeTrueCondition.INSTANCE;
    }
    False falsePred = node.getFalse();
    if (falsePred != null) {
        throw new IllegalArgumentException("There is no False condition in KNIME.");
    }
    throw new IllegalStateException("The pmmlNode contains no valid Predicate.");
}
Also used : True(org.dmg.pmml.TrueDocument.True) CompoundPredicate(org.dmg.pmml.CompoundPredicateDocument.CompoundPredicate) False(org.dmg.pmml.FalseDocument.False) SimplePredicate(org.dmg.pmml.SimplePredicateDocument.SimplePredicate) SimpleSetPredicate(org.dmg.pmml.SimpleSetPredicateDocument.SimpleSetPredicate)

Aggregations

CompoundPredicate (org.dmg.pmml.CompoundPredicateDocument.CompoundPredicate)1 False (org.dmg.pmml.FalseDocument.False)1 SimplePredicate (org.dmg.pmml.SimplePredicateDocument.SimplePredicate)1 SimpleSetPredicate (org.dmg.pmml.SimpleSetPredicateDocument.SimpleSetPredicate)1 True (org.dmg.pmml.TrueDocument.True)1