Code example for Map

Methods: containsKey, get, put

0
     * Puts the entry with the specified photo file ID into the store. 
     * @param id The photo file ID to identify the entry by. 
     * @param entry The entry to store. 
     */ 
    private void putEntry(long id, Entry entry) {
        if (!mEntries.containsKey(id)) {
            mTotalSize += entry.size;
        } else { 
            Entry oldEntry = mEntries.get(id);
            mTotalSize += (entry.size - oldEntry.size);
        } 
        mEntries.put(id, entry);
    } 
 
    /** 
     * Removes the entry identified by the given photo file ID from the store, removing 
     * the associated photo file entry from the database. 
     */ 
    private void removeEntry(long id) {
        Entry entry = mEntries.get(id);
        if (entry != null) {