SimpleSetPredicate simpleSetPredicate = new SimpleSetPredicate(); if ("!=".equalsIgnoreCase(operator)) { simpleSetPredicate.setBooleanOperator(PMMLOperators.IS_NOT_IN); } else { simpleSetPredicate.setBooleanOperator(PMMLOperators.IS_IN);
private void setupSimpleSetPredicate(int index, String fieldName, String operator, Array values) { if (index < 0 || index >= simpleSetPredicate.length) { throw new IndexOutOfBoundsException("Invalid index for setting up SimpleSetPredicate"); } simpleSetPredicate[index] = new SimpleSetPredicate(); simpleSetPredicate[index].setField(fieldName); simpleSetPredicate[index].setBooleanOperator(operator); simpleSetPredicate[index].setArray(values); }
@Before public void setUp() throws Exception { predicate = new SimpleSetPredicate(); predicate.setField("TF1"); predicate.setBooleanOperator("isIn"); }
@Test public void testNegativeMembership() { Array array = new Array(); array.setType("real"); array.setContent("3.14 29.5 17 71"); array.setN(new BigInteger("4")); predicate.setArray(array); predicate.setBooleanOperator("isNotIn"); String expected = "( mTF1 == false ) && ( vTF1 not in ( 3.14, 29.5, 17.0, 71.0 ) )"; doPredicateRetrieve(expected); }