Dynamisches Exclude

Beispiel:

  new IntGreater( 0 ) // x > 0

exkludiert

  new IntLesser( 0 ) // x < 0


Abstrakte Methode zum Mitteilen der
Excludierung an den Code-Generator:

  // in Klasse IntGreater
  public boolean isExcludeTo(
          final PrimitivPredicate otherPredicateToCheck )
  {
    if ( otherPredicateToCheck instanceof IntLesser ) {
        return ( (IntLesser) otherPredicateToCheck ).intLtValue <= this.intGtValue;
    }

    if ( otherPredicateToCheck instanceof IntEqual )
    {
        return ( (IntEqual) otherPredicateToCheck ).intEqValue <= this.intGtValue;
    }
    return false;
  }
Anfang weiter