public synchronized Object get(Object key) {
        ConcurrentHashMap<Object, Object> tableRef = primaryTable;
        Entry curEntry = (Entry) primaryTable.get(key);

        // Not found in primary
        if (curEntry == null) {
            tableRef = secondaryTable;
            curEntry = (Entry) secondaryTable.get(key);

            // Not found in primary or secondary
            if (curEntry == null) {
                tableRef = tertiaryTable;
                curEntry = (Entry) tertiaryTable.get(key);
            }

            // Not found in primary, secondary, or tertiary
            if (curEntry == null) {
                tableRef = null;
            }
        }

        // If found in secondary or tertiary, move entry to primary
        if ((tableRef != null) && (tableRef != primaryTable)) {
            primaryTable.put(key, curEntry);
            tableRef.remove(key);
        }

        // If not present even in any table, add an empty entry
        // that can be found faster for update
        if (tableRef == null) {
            curEntry = (Entry) primaryTable.get(key);
            if (curEntry == null) {
                curEntry = new Entry();
                Entry prevEntry = (Entry) primaryTable.putIfAbsent(key, curEntry);
                if (prevEntry != null)
                    curEntry = prevEntry; // We lost the race, so use the entry from the other thread
            }
        }
        return curEntry.value;
    }
public synchronized Object get ( Object key ) { ConcurrentHashMap < Object , Object > tableRef = primaryTable ; Entry curEntry = ( Entry ) primaryTable . get ( key ) ; if ( curEntry == null ) { tableRef = secondaryTable ; curEntry = ( Entry ) secondaryTable . get ( key ) ; if ( curEntry == null ) { tableRef = tertiaryTable ; curEntry = ( Entry ) tertiaryTable . get ( key ) ; } if ( curEntry == null ) { tableRef = null ; } } if ( ( tableRef != null ) && ( tableRef != primaryTable ) ) { primaryTable . put ( key , curEntry ) ; tableRef . remove ( key ) ; } if ( tableRef == null ) { curEntry = ( Entry ) primaryTable . get ( key ) ; if ( curEntry == null ) { curEntry = new Entry ( ) ; Entry prevEntry = ( Entry ) primaryTable . putIfAbsent ( key , curEntry ) ; if ( prevEntry != null ) curEntry = prevEntry ; } } return curEntry . value ; }
Find and return the object associated with the specified key.