//----------------------------------------------------------------------- /** * Checks whether the map contains the specified value. * * @param value the value to search for * @return true if the map contains the value */ public override bool containsValue(Object value) { // override uses faster iterator if (value == null) { for (LinkEntry entry = header.after; entry != header; entry = entry.after) { if (entry.getValue() == null) { return(true); } } } else { for (LinkEntry entry = header.after; entry != header; entry = entry.after) { if (isEqualValue(value, entry.getValue())) { return(true); } } } return(false); }
public override String ToString() { if (last != null) { return("Iterator[" + last.getKey() + "=" + last.getValue() + "]"); } else { return("Iterator[]"); } }
//----------------------------------------------------------------------- /** * Gets the value mapped to the key specified. * <p> * This operation changes the position of the key in the map to the * most recently used position (first). * * @param key the key * @return the mapped value, null if no match */ public override Object get(Object key) { LinkEntry entry = (LinkEntry)getEntry(key); if (entry == null) { return(null); } moveToMRU(entry); return(entry.getValue()); }