@Test public void testConstraint() { BDD constraint = dstIp("1.2.3.4"); Transition transition = new Constraint(constraint); assertThat(transition.transitForward(ONE), equalTo(constraint)); assertThat(transition.transitBackward(ONE), equalTo(constraint)); assertThat(transition.transitForward(ZERO), equalTo(ZERO)); assertThat(transition.transitBackward(ZERO), equalTo(ZERO)); BDD bdd = srcIp("6.7.8.9"); assertThat(transition.transitForward(bdd), equalTo(constraint.and(bdd))); assertThat(transition.transitBackward(bdd), equalTo(constraint.and(bdd))); bdd = dstIp("2.3.4.5"); assertThat(transition.transitForward(bdd), equalTo(ZERO)); assertThat(transition.transitBackward(bdd), equalTo(ZERO)); }
Constraint(BDD constraint) { checkArgument(!constraint.isOne(), "Cannot build Constraint with BDD 1. Use Identity instead."); checkArgument(!constraint.isZero(), "Cannot build Constraint with BDD 0. Use Zero instead."); _constraint = constraint; }
Constraint implements Transition { Constraint(BDD constraint) { checkArgument(!constraint.isOne(), "Cannot build Constraint with BDD 1. Use Identity instead."); checkArgument(!constraint.isZero(), "Cannot build Constraint with BDD 0. Use Zero instead."); _constraint = constraint; } }
Constraint implements Transition { Constraint(BDD constraint) { checkArgument(!constraint.isOne(), "Cannot build Constraint with BDD 1. Use Identity instead."); checkArgument(!constraint.isZero(), "Cannot build Constraint with BDD 0. Use Zero instead."); _constraint = constraint; } Constraint(BDD constraint); }
Constraint implements Transition { Constraint(BDD constraint) { checkArgument(!constraint.isOne(), "Cannot build Constraint with BDD 1. Use Identity instead."); checkArgument(!constraint.isZero(), "Cannot build Constraint with BDD 0. Use Zero instead."); _constraint = constraint; } Constraint(BDD constraint); @Override boolean equals(Object o); @Override int hashCode(); @Override BDD transitForward(BDD bdd); @Override BDD transitBackward(BDD bdd); @Override String toString(); }
Constraint implements Transition { Constraint(BDD constraint) { checkArgument(!constraint.isOne(), "Cannot build Constraint with BDD 1. Use Identity instead."); checkArgument(!constraint.isZero(), "Cannot build Constraint with BDD 0. Use Zero instead."); _constraint = constraint; } Constraint(BDD constraint); @Override boolean equals(Object o); @Override int hashCode(); @Override BDD transitForward(BDD bdd); @Override BDD transitBackward(BDD bdd); @Override String toString();  }