Code example for HashMap

Methods: isEmpty, remove

0
            } 
        } 
 
        return START_STICKY;
    } 
 
    /** 
     * Called when one specific passphrase for keyId timed out 
     *  
     * @param context 
     * @param keyId 
     */ 
    private void timeout(Context context, long keyId) {
        // remove passphrase corresponding to keyId from memory 
        mPassphraseCache.remove(keyId);
 
        Log.d(TAG, "Timeout of keyId " + keyId + ", removed from memory!");
 
        // stop whole service if no cached passphrases remaining 
        if (mPassphraseCache.isEmpty()) {
            Log.d(TAG, "No passphrases remaining in memory, stopping service!");