Code example for WeakHashMap

Methods: getput

0
 
    /** 
     * Get thread status and create one if specified. 
     */ 
    private synchronized ThreadStatus getOrCreateThreadStatus(Thread t) {
        ThreadStatus status = mThreadStatus.get(t);
        if (status == null) {
            status = new ThreadStatus();
            mThreadStatus.put(t, status);
        } 
        return status;
    } 
 
    public synchronized boolean canThreadDecoding(Thread t) {
        ThreadStatus status = mThreadStatus.get(t);
        if (status == null) {
            // allow decoding by default 
            return true; 
        } 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE