Code example for BlockingQueue

Methods: clear, take

0
    @Override 
    public Move stateMachineSelectMove(long timeout)
            throws TransitionDefinitionException, MoveDefinitionException, 
            GoalDefinitionException { 
    	theGUI.beginPlay();
        theQueue.clear();
        theGUI.updateGameState(getCurrentState());
        try { 
            return theQueue.take();
        } catch(Exception e) {
            e.printStackTrace();
            return null; 
        } 
    } 
 
    @Override 
    public StateMachine getInitialStateMachine() { 
        return new ProverStateMachine(); 
    } 
 
    @Override