Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class ReadOnlyNavigableMapFacade<K,V>
java.lang.Object
org.jhotdraw8.icollection.facade.ReadOnlyMapFacade<K,V>
org.jhotdraw8.icollection.facade.ReadOnlyNavigableMapFacade<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Iterable<Map.Entry<K,,V>> ReadOnlyMap<K,,V> ReadOnlyNavigableMap<K,,V> ReadOnlySequencedMap<K,,V> ReadOnlySortedMap<K,V>
public class ReadOnlyNavigableMapFacade<K,V>
extends ReadOnlyMapFacade<K,V>
implements ReadOnlyNavigableMap<K,V>
Provides a
ReadOnlyNavigableMap facade to a set of ReadOnlyNavigableMap functions.- Author:
- Werner Randelshofer
-
Field Summary
Fields inherited from class org.jhotdraw8.icollection.facade.ReadOnlyMapFacade
containsKeyFunction, getFunction, iteratorFunction, sizeFunction -
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyNavigableMapFacade(@NonNull NavigableMap<K, V> target) ReadOnlyNavigableMapFacade(@NonNull Supplier<Iterator<Map.Entry<K, V>>> iteratorFunction, @NonNull Supplier<Iterator<Map.Entry<K, V>>> reverseIteratorFunction, @NonNull IntSupplier sizeFunction, @NonNull Predicate<Object> containsKeyFunction, @NonNull Function<K, V> getFunction, @NonNull Supplier<Map.Entry<K, V>> firstEntryFunction, @NonNull Supplier<Map.Entry<K, V>> lastEntryFunction, @NonNull Function<K, Map.Entry<K, V>> ceilingFunction, @NonNull Function<K, Map.Entry<K, V>> floorFunction, @NonNull Function<K, Map.Entry<K, V>> higherFunction, @NonNull Function<K, Map.Entry<K, V>> lowerFunction, int characteristics, @Nullable Supplier<Comparator<? super K>> comparator) -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry(K k) Returns the least entry in this map with a key greater than or equal to the given key, or null if there is no such entry.intReturns the spliterator characteristics of the key set.@Nullable Comparator<? super K> Returns the comparator used to order the keys in this map, or null if this set uses the natural ordering of its keys.Gets the first entry in this map ornullif this map is empty.floorEntry(K k) Returns the greatest entry in this map with a key less than or equal to the given key, or null if there is no such entry.higherEntry(K k) Returns the least entry in this map with a key greater than the given key, or null if there is no such entry.Gets the last entry in this map ornullif this map is empty.lowerEntry(K k) Returns the greatest entry in this map with a key less than the given key, or null if there is no such entry.Returns a reversed-order view of this map.Methods inherited from class org.jhotdraw8.icollection.facade.ReadOnlyMapFacade
containsEntry, containsKey, get, isEmpty, iterator, sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyMap
containsEntry, containsKey, containsValue, equals, get, getOrDefault, hashCode, isEmpty, iterator, sizeMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyNavigableMap
ceilingKey, floorKey, higherKey, lowerKeyMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySequencedMap
asMap, readOnlyEntrySet, readOnlyKeySet, readOnlyValuesMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySortedMap
spliterator
-
Constructor Details
-
ReadOnlyNavigableMapFacade
public ReadOnlyNavigableMapFacade(@NonNull Supplier<Iterator<Map.Entry<K, V>>> iteratorFunction, @NonNull Supplier<Iterator<Map.Entry<K, V>>> reverseIteratorFunction, @NonNull IntSupplier sizeFunction, @NonNull Predicate<Object> containsKeyFunction, @NonNull Function<K, V> getFunction, @NonNull Supplier<Map.Entry<K, V>> firstEntryFunction, @NonNull Supplier<Map.Entry<K, V>> lastEntryFunction, @NonNull Function<K, Map.Entry<K, V>> ceilingFunction, @NonNull Function<K, Map.Entry<K, V>> floorFunction, @NonNull Function<K, Map.Entry<K, V>> higherFunction, @NonNull Function<K, Map.Entry<K, V>> lowerFunction, int characteristics, @Nullable Supplier<Comparator<? super K>> comparator)
-
Method Details
-
ceilingEntry
Description copied from interface:ReadOnlyNavigableMapReturns the least entry in this map with a key greater than or equal to the given key, or null if there is no such entry.- Specified by:
ceilingEntryin interfaceReadOnlyNavigableMap<K,V> - Parameters:
k- the given key- Returns:
- ceiling entry or null
-
floorEntry
Description copied from interface:ReadOnlyNavigableMapReturns the greatest entry in this map with a key less than or equal to the given key, or null if there is no such entry.- Specified by:
floorEntryin interfaceReadOnlyNavigableMap<K,V> - Parameters:
k- the given key- Returns:
- floor entry or null
-
higherEntry
Description copied from interface:ReadOnlyNavigableMapReturns the least entry in this map with a key greater than the given key, or null if there is no such entry.- Specified by:
higherEntryin interfaceReadOnlyNavigableMap<K,V> - Parameters:
k- the given key- Returns:
- higher entry or null
-
lowerEntry
Description copied from interface:ReadOnlyNavigableMapReturns the greatest entry in this map with a key less than the given key, or null if there is no such entry.- Specified by:
lowerEntryin interfaceReadOnlyNavigableMap<K,V> - Parameters:
k- the given key- Returns:
- lower entry or null
-
readOnlyReversed
Description copied from interface:ReadOnlySequencedMapReturns a reversed-order view of this map.Changes to the underlying map are visible in the reversed view.
- Specified by:
readOnlyReversedin interfaceReadOnlySequencedMap<K,V> - Returns:
- a reversed-order view of this map
-
firstEntry
Description copied from interface:ReadOnlySequencedMapGets the first entry in this map ornullif this map is empty.- Specified by:
firstEntryin interfaceReadOnlySequencedMap<K,V> - Returns:
- the first entry or
null
-
lastEntry
Description copied from interface:ReadOnlySequencedMapGets the last entry in this map ornullif this map is empty.- Specified by:
lastEntryin interfaceReadOnlySequencedMap<K,V> - Returns:
- the last entry or
null
-
comparator
Description copied from interface:ReadOnlySortedMapReturns the comparator used to order the keys in this map, or null if this set uses the natural ordering of its keys.- Specified by:
comparatorin interfaceReadOnlySortedMap<K,V> - Returns:
- comparator or null
-
characteristics
public int characteristics()Description copied from interface:ReadOnlySequencedMapReturns the spliterator characteristics of the key set. This implementation returnsSpliterator.SIZED|Spliterator.DISTINCT.- Specified by:
characteristicsin interfaceReadOnlyMap<K,V> - Specified by:
characteristicsin interfaceReadOnlySequencedMap<K,V> - Specified by:
characteristicsin interfaceReadOnlySortedMap<K,V> - Returns:
- characteristics.
-