/** * @throws NoSuchElementException {@inheritDoc} */ public K firstKey() { return key(getFirstEntry()); }
/** * @since 1.6 */ public Map.Entry<K,V> firstEntry() { return exportEntry(getFirstEntry()); }
/** * @throws NoSuchElementException {@inheritDoc} */ public K firstKey() { return key(getFirstEntry()); }
/** * @since 1.6 */ public Map.Entry<K,V> firstEntry() { return exportEntry(getFirstEntry()); }
Iterator<K> keyIterator() { return new KeyIterator(getFirstEntry()); }
Iterator<K> keyIterator() { return new KeyIterator(getFirstEntry()); }
/** * @since 1.6 */ public Map.Entry<K,V> pollFirstEntry() { Entry<K,V> p = getFirstEntry(); Map.Entry<K,V> result = exportEntry(p); if (p != null) deleteEntry(p); return result; }
/** * @since 1.6 */ public Map.Entry<K,V> pollFirstEntry() { Entry<K,V> p = getFirstEntry(); Map.Entry<K,V> result = exportEntry(p); if (p != null) deleteEntry(p); return result; }
Entry<K, V> root = map.getFirstEntry(); while( root.parent != null ) root = root.parent;
/** * Returns {@code true} if this map maps one or more keys to the * specified value. More formally, returns {@code true} if and only if * this map contains at least one mapping to a value {@code v} such * that {@code (value==null ? v==null : value.equals(v))}. This * operation will probably require time linear in the map size for * most implementations. * * @param value value whose presence in this map is to be tested * @return {@code true} if a mapping to {@code value} exists; * {@code false} otherwise * @since 1.2 */ public boolean containsValue(Object value) { for (Entry<K,V> e = getFirstEntry(); e != null; e = successor(e)) if (valEquals(value, e.value)) return true; return false; }
/** * Returns {@code true} if this map maps one or more keys to the * specified value. More formally, returns {@code true} if and only if * this map contains at least one mapping to a value {@code v} such * that {@code (value==null ? v==null : value.equals(v))}. This * operation will probably require time linear in the map size for * most implementations. * * @param value value whose presence in this map is to be tested * @return {@code true} if a mapping to {@code value} exists; * {@code false} otherwise * @since 1.2 */ public boolean containsValue(Object value) { for (Entry<K,V> e = getFirstEntry(); e != null; e = successor(e)) if (valEquals(value, e.value)) return true; return false; }
final TreeMap.Entry<K,V> absLowest() { TreeMap.Entry<K,V> e = (fromStart ? m.getFirstEntry() : (loInclusive ? m.getCeilingEntry(lo) : m.getHigherEntry(lo))); return (e == null || tooHigh(e.key)) ? null : e; }
final TreeMap.Entry<K,V> absLowest() { TreeMap.Entry<K,V> e = (fromStart ? m.getFirstEntry() : (loInclusive ? m.getCeilingEntry(lo) : m.getHigherEntry(lo))); return (e == null || tooHigh(e.key)) ? null : e; }