@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return delegate().headMap(toKey, inclusive); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return Maps.unmodifiableNavigableMap(delegate.headMap(toKey, inclusive)); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return filterEntries(unfiltered.headMap(toKey, inclusive), entryPredicate); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return filterEntries(unfiltered.headMap(toKey, inclusive), entryPredicate); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return Maps.unmodifiableNavigableMap(delegate.headMap(toKey, inclusive)); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return delegate().headMap(toKey, inclusive); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { synchronized (mutex) { return navigableMap(delegate().headMap(toKey, inclusive), mutex); } }
@CollectionSize.Require(absent = ZERO) public void testHeadMapExclusive() { assertFalse(navigableMap.headMap(a.getKey(), false).containsKey(a.getKey())); }
@CollectionSize.Require(absent = ZERO) public void testHeadMapInclusive() { assertTrue(navigableMap.headMap(a.getKey(), true).containsKey(a.getKey())); }
@Override public NavigableMap<K, V2> headMap(K toKey, boolean inclusive) { return transformEntries(fromMap().headMap(toKey, inclusive), transformer); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { return new SafeTreeMap<>(delegate.headMap(checkValid(toKey), inclusive)); }
@Override public NavigableSet<K> headSet(K toElement, boolean inclusive) { return map().headMap(toElement, inclusive).navigableKeySet(); }
@Override public NavigableMap<K, V> tailMap(K fromKey, boolean inclusive) { return forward().headMap(fromKey, inclusive).descendingMap(); }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { synchronized (mutex) { return navigableMap(delegate().headMap(toKey, inclusive), mutex); } }
@Override public NavigableMap<K, V> headMap(K toKey, boolean inclusive) { assertTrue(Thread.holdsLock(mutex)); return delegate().headMap(toKey, inclusive); }
@Override public NavigableSet<K> headSet(K toElement, boolean inclusive) { return map().headMap(toElement, inclusive).navigableKeySet(); }
@Override public NavigableMap<K, V> tailMap(K fromKey, boolean inclusive) { return forward().headMap(fromKey, inclusive).descendingMap(); }
@Override NavigableMap<K, V> createSubMap(SortedMap<K, V> sortedMap, K firstExclusive, K lastExclusive) { NavigableMap<K, V> map = (NavigableMap<K, V>) sortedMap; if (from == Bound.NO_BOUND && to == Bound.INCLUSIVE) { return map.headMap(lastInclusive, true); } else if (from == Bound.EXCLUSIVE && to == Bound.NO_BOUND) { return map.tailMap(firstExclusive, false); } else if (from == Bound.EXCLUSIVE && to == Bound.EXCLUSIVE) { return map.subMap(firstExclusive, false, lastExclusive, false); } else if (from == Bound.EXCLUSIVE && to == Bound.INCLUSIVE) { return map.subMap(firstExclusive, false, lastInclusive, true); } else if (from == Bound.INCLUSIVE && to == Bound.INCLUSIVE) { return map.subMap(firstInclusive, true, lastInclusive, true); } else { return (NavigableMap<K, V>) super.createSubMap(map, firstExclusive, lastExclusive); } } }
public void testHeadMap_K() { NavigableMap<String, Integer> map = create(); SortedMap<String, Integer> headMap = map.headMap("a"); assertTrue(headMap instanceof SynchronizedSortedMap); assertSame(mutex, ((SynchronizedSortedMap<String, Integer>) headMap).mutex); }
public void testHeadMap_K_B() { NavigableMap<String, Integer> map = create(); NavigableMap<String, Integer> headMap = map.headMap("a", true); assertTrue(headMap instanceof SynchronizedNavigableMap); assertSame(mutex, ((SynchronizedNavigableMap<String, Integer>) headMap).mutex); }