@Test public void testSimplePredUsingXor() { CompoundPredicate predicate = new CompoundPredicate(); predicate.setBooleanOperator("xor"); setupSimplePredicate(0,"TF1",SimpleSegmentPredicate.LESSER_EQUAL,"0"); setupSimplePredicate(1,"TF1",SimpleSegmentPredicate.GREATER,"4"); for (int x = 0; x < 2; x++) { predicate.getSimplePredicatesAndCompoundPredicatesAndSimpleSetPredicates().add(simplePredicate[x]); } CompoundSegmentPredicate testPredicate = new CompoundSegmentPredicate(predicate); String text = testPredicate.getPredicateRule(); assertNotNull(text); assertEquals(text,"((( mTF1 == false ) && ( vTF1 <= 0 )) ^ (( mTF1 == false ) && ( vTF1 > 4 )))"); }
@Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } CompoundSegmentPredicate();  CompoundSegmentPredicate(CompoundPredicate predicate); }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } CompoundSegmentPredicate();  CompoundSegmentPredicate(CompoundPredicate predicate); List<String> getPredicateFieldNames(); List<String> getFieldMissingFieldNames(); String getPrimaryPredicateRule(); String getNextPredicateRule(int lastPredicate); int getSubpredicateCount(); boolean hasSurrogation(); @Override String getPredicateRule(); @Override boolean isAlwaysTrue(); @Override boolean isAlwaysFalse(); }
CompoundSegmentPredicate implements PredicateRuleProducer { @Override public String getPredicateRule() { if (booleanOperator.equalsIgnoreCase("and")) { return buildAndPredicate(); } else if (booleanOperator.equalsIgnoreCase("or")) { return buildOrPredicate(); } else if (booleanOperator.equalsIgnoreCase("xor")) { return buildXorPredicate(); } else if (hasSurrogation()) { return buildSurrogationPredicate(); } return null; } CompoundSegmentPredicate();  CompoundSegmentPredicate(CompoundPredicate predicate); List<String> getPredicateFieldNames(); List<String> getFieldMissingFieldNames(); String getPrimaryPredicateRule(); String getNextPredicateRule(int lastPredicate); int getSubpredicateCount(); boolean hasSurrogation(); @Override String getPredicateRule(); @Override boolean isAlwaysTrue(); @Override boolean isAlwaysFalse();  }