public boolean checkGuard ( Task < E > control ) { // No guard to check if ( guard == null ) return true ; // Check the guard of the guard recursively if ( ! guard . checkGuard ( control ) ) return false ; // Use the tree's guard evaluator task to check the guard of this task guard . setControl ( control . tree . guardEvaluator ) ; guard . start ( ) ; guard . run ( ) ; switch ( guard . getStatus ( ) ) { case SUCCEEDED : return true ; case FAILED : return false ; default : throw new IllegalStateException ( "Illegal guard status '" + guard . getStatus ( ) + "'. Guards must either succeed or fail in one step." ) ; } }
Checks the guard of this task .