Module org.jhotdraw8.icollection
Interface ReadOnlySequencedMap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Superinterfaces:
Iterable<Map.Entry<K,,V>> ReadOnlyMap<K,V>
- All Known Subinterfaces:
ImmutableNavigableMap<K,,V> ImmutableSequencedMap<K,,V> ImmutableSortedMap<K,,V> ReadOnlyNavigableMap<K,,V> ReadOnlySortedMap<K,V>
- All Known Implementing Classes:
ChampVectorMap,MutableChampVectorMap,MutableRedBlackMap,ReadOnlyNavigableMapFacade,ReadOnlySequencedMapFacade,ReadOnlySortedMapFacade,RedBlackMap
A read-only interface to a sequenced map. A sequenced map has a well-defined encounter order, that supports
operations at both ends, and that is reversible.
References:
- JEP draft: Sequenced Collections
- java.ne
-
Method Summary
Modifier and TypeMethodDescriptiondefault SequencedMap<K, V> asMap()Wraps this map in theMapinterface - without copying.default intReturns the spliterator characteristics of the key set.Gets the first entry in this map ornullif this map is empty.Gets the last entry in this map ornullif this map is empty.default ReadOnlySequencedSet<Map.Entry<K, V>> Returns aReadOnlySequencedSetview of the entries contained in this map.default ReadOnlySequencedSet<K> Returns aReadOnlySequencedSetview of the keys contained in this map.Returns a reversed-order view of this map.default ReadOnlySequencedCollection<V> Returns aReadOnlySequencedCollectionview of the values contained in this map.Methods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyMap
containsEntry, containsKey, containsValue, equals, get, getOrDefault, hashCode, isEmpty, iterator, size, spliterator
-
Method Details
-
readOnlyReversed
ReadOnlySequencedMap<K,V> readOnlyReversed()Returns a reversed-order view of this map.Changes to the underlying map are visible in the reversed view.
- Returns:
- a reversed-order view of this map
-
firstEntry
Gets the first entry in this map ornullif this map is empty.- Returns:
- the first entry or
null - Throws:
NoSuchElementException- if the map is empty
-
lastEntry
Gets the last entry in this map ornullif this map is empty.- Returns:
- the last entry or
null - Throws:
NoSuchElementException- if the map is empty
-
readOnlyEntrySet
Returns aReadOnlySequencedSetview of the entries contained in this map.- Specified by:
readOnlyEntrySetin interfaceReadOnlyMap<K,V> - Returns:
- a
ReadOnlySequencedSetview of the entries
-
characteristics
default int characteristics()Returns the spliterator characteristics of the key set. This implementation returnsSpliterator.SIZED|Spliterator.DISTINCT.- Specified by:
characteristicsin interfaceReadOnlyMap<K,V> - Returns:
- characteristics.
-
readOnlyKeySet
Returns aReadOnlySequencedSetview of the keys contained in this map.- Specified by:
readOnlyKeySetin interfaceReadOnlyMap<K,V> - Returns:
- a
ReadOnlySequencedSetview of the keys
-
readOnlyValues
Returns aReadOnlySequencedCollectionview of the values contained in this map.- Specified by:
readOnlyValuesin interfaceReadOnlyMap<K,V> - Returns:
- a
ReadOnlySequencedCollectionview of the values
-
asMap
Description copied from interface:ReadOnlyMapWraps this map in theMapinterface - without copying.- Specified by:
asMapin interfaceReadOnlyMap<K,V> - Returns:
- the wrapped map
-