private static Selector DNF0 ( Selector tree ) { if ( ! ( tree instanceof Operator ) ) return tree ; Operator oper = ( Operator ) tree ; switch ( oper . getOp ( ) ) { case Selector . AND : return processAND ( oper . getOperands ( ) [ 0 ] , oper . getOperands ( ) [ 1 ] ) ; case Selector . OR : return makeOR ( DNF0 ( oper . getOperands ( ) [ 0 ] ) , DNF0 ( oper . getOperands ( ) [ 1 ] ) ) ; default : return tree ; } }
Working recursive subroutine of DNF