/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object lowerKey(Object key) { Node n = findNear(key, LT); return (n == null)? null : n.key; }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object ceilingKey(Object key) { Node n = findNear(key, GT|EQ); return (n == null)? null : n.key; }
/** * @param key the key * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object floorKey(Object key) { Node n = findNear(key, LT|EQ); return (n == null)? null : n.key; }
/** * @param key the key * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object floorKey(Object key) { Node n = findNear(key, LT|EQ); return (n == null)? null : n.key; }
/** * @param key the key * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object higherKey(Object key) { Node n = findNear(key, GT); return (n == null)? null : n.key; }
/** * @param key the key * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object higherKey(Object key) { Node n = findNear(key, GT); return (n == null)? null : n.key; }
/** * @param key the key * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object higherKey(Object key) { Node n = findNear(key, GT); return (n == null)? null : n.key; }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object lowerKey(Object key) { Node n = findNear(key, LT); return (n == null)? null : n.key; }
/** * @param key the key * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object floorKey(Object key) { Node n = findNear(key, LT|EQ); return (n == null)? null : n.key; }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object lowerKey(Object key) { Node n = findNear(key, LT); return (n == null)? null : n.key; }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object ceilingKey(Object key) { Node n = findNear(key, GT|EQ); return (n == null)? null : n.key; }
/** * @throws ClassCastException {@inheritDoc} * @throws NullPointerException if the specified key is null */ public Object ceilingKey(Object key) { Node n = findNear(key, GT|EQ); return (n == null)? null : n.key; }
private void descend() { for (;;) { next = m.findNear(lastReturned.key, LT); if (next == null) break; Object x = next.value; if (x != null && x != next) { if (tooLow(next.key)) next = null; else nextValue = x; break; } } }
/** * Returns SimpleImmutableEntry for results of findNear. * @param key the key * @param rel the relation -- OR'ed combination of EQ, LT, GT * @return Entry fitting relation, or null if no such */ AbstractMap.SimpleImmutableEntry getNear(Object key, int rel) { for (;;) { Node n = findNear(key, rel); if (n == null) return null; AbstractMap.SimpleImmutableEntry e = n.createSnapshot(); if (e != null) return e; } }