public synchronized Object update ( String key , Object value ) { // evict until size < maxSize while ( isEvictionRequired ( ) && entryLimit > 0 && entryLimit < Integer . MAX_VALUE ) { evictStaleEntries ( ) ; } CacheEntry oldEntry = null ; CacheEntry curEntry = new CacheEntry ( value ) ; if ( primaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; } else if ( secondaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) secondaryTable . put ( key , curEntry ) ; } else if ( tertiaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) tertiaryTable . put ( key , curEntry ) ; } else { oldEntry = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; } return oldEntry != null ? oldEntry . value : null ; }
Update the value into the Cache using the specified key but do not change the table level of the cache . If the key is not in any table add it to the primaryTable