Module org.jhotdraw8.icollection
Package org.jhotdraw8.icollection.facade
Class ReadOnlySortedMapFacade<K,V>
java.lang.Object
org.jhotdraw8.icollection.facade.ReadOnlyMapFacade<K,V>
org.jhotdraw8.icollection.facade.ReadOnlySortedMapFacade<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Iterable<Map.Entry<K,,V>> ReadOnlyMap<K,,V> ReadOnlySequencedMap<K,,V> ReadOnlySortedMap<K,V>
public class ReadOnlySortedMapFacade<K,V>
extends ReadOnlyMapFacade<K,V>
implements ReadOnlySortedMap<K,V>
Provides a
ReadOnlySortedMap facade to a set of ReadOnlySortedMap functions.- Author:
- Werner Randelshofer
-
Field Summary
Fields inherited from class org.jhotdraw8.icollection.facade.ReadOnlyMapFacade
containsKeyFunction, getFunction, iteratorFunction, sizeFunction -
Constructor Summary
ConstructorsConstructorDescriptionReadOnlySortedMapFacade(@NonNull SortedMap<K, V> target) ReadOnlySortedMapFacade(@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, int characteristics, @Nullable Supplier<Comparator<? super K>> comparator) -
Method Summary
Modifier and TypeMethodDescriptionintReturns 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.Gets the last entry in this map ornullif this map is empty.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.ReadOnlySequencedMap
asMap, readOnlyEntrySet, readOnlyKeySet, readOnlyValuesMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlySortedMap
spliterator
-
Constructor Details
-
ReadOnlySortedMapFacade
-
ReadOnlySortedMapFacade
public ReadOnlySortedMapFacade(@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, int characteristics, @Nullable Supplier<Comparator<? super K>> comparator)
-
-
Method Details
-
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.
-