Code example for LinkedBlockingDeque

0
    } 
 
    public static ThreadPoolExecutor pool(int maxSize, int wait, 
        TimeUnit unit) { 
        return new ThreadPoolExecutor(maxSize, maxSize, wait, unit, 
            new LinkedBlockingDeque<Runnable>()); 
    } 
 
    /** 
     * Show some text in a TextView if the text is non-empty. 
     * Otherwise, hide the TextView. 
     */ 
    public static void textOrHide(TextView textView, String text) { 
        if (text == null || text.length() == 0) { 
            textView.setVisibility(View.GONE); 
            textView.setText(""); 
        } else { 
            textView.setVisibility(View.VISIBLE); 
            textView.setText(text); 
        } 
    }