/** * Looks up the DHTObject associated with <code>key</code> in the local database. * * @param key the KademliaOverlayKey of the data item to be looked up. * @return the DHTObject associated with <code>key</code>. If no such object exists (or it has * expired), <code>null</code> is returned. */ public final DHTObject get(final KademliaOverlayKey key) { final KademliaIndexEntry indexEntry = index.get(key); if (indexEntry == null) { // no entry known return null; } else if (indexEntry.hasExpired()) { // old entry expired index.remove(key); return null; } return indexEntry.getValue(); }