/** * A sensible definition of {@link #ceilingKey} in terms of {@code ceilingEntry}. If you override * {@code ceilingEntry}, you may wish to override {@code ceilingKey} to forward to this * implementation. */ protected K standardCeilingKey(K key) { return keyOrNull(ceilingEntry(key)); }
@Override public K lowerKey(K key) { return delegate().lowerKey(key); }
/** * A sensible definition of {@link #lastEntry} in terms of the {@code iterator()} of the {@link * #entrySet} of {@link #descendingMap}. If you override {@code descendingMap}, you may wish to * override {@code lastEntry} to forward to this implementation. */ protected Entry<K, V> standardLastEntry() { return Iterables.getFirst(descendingMap().entrySet(), null); }
/** * A sensible definition of {@link #lowerKey} in terms of {@code lowerEntry}. If you override * {@link #lowerEntry}, you may wish to override {@code lowerKey} to forward to this * implementation. */ protected K standardLowerKey(K key) { return keyOrNull(lowerEntry(key)); }
/** * A sensible definition of {@link #higherKey} in terms of {@code higherEntry}. If you override * {@code higherEntry}, you may wish to override {@code higherKey} to forward to this * implementation. */ protected K standardHigherKey(K key) { return keyOrNull(higherEntry(key)); }
/** * A sensible definition of {@link #floorKey} in terms of {@code floorEntry}. If you override * {@code floorEntry}, you may wish to override {@code floorKey} to forward to this * implementation. */ protected K standardFloorKey(K key) { return keyOrNull(floorEntry(key)); }
/** * A sensible definition of {@link #firstEntry} in terms of the {@code iterator()} of {@link * #entrySet}. If you override {@code entrySet}, you may wish to override {@code firstEntry} to * forward to this implementation. */ protected Entry<K, V> standardFirstEntry() { return Iterables.getFirst(entrySet(), null); }
/** * A sensible definition of {@link #headMap(Object)} in terms of {@link #headMap(Object, * boolean)}. If you override {@code headMap(K, boolean)}, you may wish to override {@code * headMap} to forward to this implementation. */ protected SortedMap<K, V> standardHeadMap(K toKey) { return headMap(toKey, false); }
/** * A sensible definition of {@link #lastKey} in terms of {@code lastEntry}. If you override {@code * lastEntry}, you may wish to override {@code lastKey} to forward to this implementation. */ protected K standardLastKey() { Entry<K, V> entry = lastEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } }
/** * A sensible definition of {@link #firstKey} in terms of {@code firstEntry}. If you override * {@code firstEntry}, you may wish to override {@code firstKey} to forward to this * implementation. */ protected K standardFirstKey() { Entry<K, V> entry = firstEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } }
/** * A sensible definition of {@link #lowerKey} in terms of {@code lowerEntry}. If you override * {@link #lowerEntry}, you may wish to override {@code lowerKey} to forward to this * implementation. */ protected K standardLowerKey(K key) { return keyOrNull(lowerEntry(key)); }
/** * A sensible definition of {@link #higherKey} in terms of {@code higherEntry}. If you override * {@code higherEntry}, you may wish to override {@code higherKey} to forward to this * implementation. */ protected K standardHigherKey(K key) { return keyOrNull(higherEntry(key)); }
/** * A sensible definition of {@link #floorKey} in terms of {@code floorEntry}. If you override * {@code floorEntry}, you may wish to override {@code floorKey} to forward to this * implementation. */ protected K standardFloorKey(K key) { return keyOrNull(floorEntry(key)); }
/** * A sensible definition of {@link #firstEntry} in terms of the {@code iterator()} of {@link * #entrySet}. If you override {@code entrySet}, you may wish to override {@code firstEntry} to * forward to this implementation. */ protected Entry<K, V> standardFirstEntry() { return Iterables.getFirst(entrySet(), null); }
/** * A sensible definition of {@link #headMap(Object)} in terms of {@link #headMap(Object, * boolean)}. If you override {@code headMap(K, boolean)}, you may wish to override {@code * headMap} to forward to this implementation. */ protected SortedMap<K, V> standardHeadMap(K toKey) { return headMap(toKey, false); }
/** * A sensible definition of {@link #lastKey} in terms of {@code lastEntry}. If you override {@code * lastEntry}, you may wish to override {@code lastKey} to forward to this implementation. */ protected K standardLastKey() { Entry<K, V> entry = lastEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } }
/** * A sensible definition of {@link #firstKey} in terms of {@code firstEntry}. If you override * {@code firstEntry}, you may wish to override {@code firstKey} to forward to this * implementation. */ protected K standardFirstKey() { Entry<K, V> entry = firstEntry(); if (entry == null) { throw new NoSuchElementException(); } else { return entry.getKey(); } }
/** * A sensible definition of {@link #pollFirstEntry} in terms of the {@code iterator} of the {@code * entrySet} of {@code descendingMap}. If you override {@code descendingMap}, you may wish to * override {@code pollFirstEntry} to forward to this implementation. */ protected Entry<K, V> standardPollLastEntry() { return Iterators.pollNext(descendingMap().entrySet().iterator()); }
/** * A sensible definition of {@link #ceilingKey} in terms of {@code ceilingEntry}. If you override * {@code ceilingEntry}, you may wish to override {@code ceilingKey} to forward to this * implementation. */ protected K standardCeilingKey(K key) { return keyOrNull(ceilingEntry(key)); }
/** * A sensible definition of {@link #lowerKey} in terms of {@code lowerEntry}. If you override * {@link #lowerEntry}, you may wish to override {@code lowerKey} to forward to this * implementation. */ protected K standardLowerKey(K key) { return keyOrNull(lowerEntry(key)); }