Interface ImSortedMap<K,​V>

    • Method Detail

      • entry

        @NotNull
        @NotNull Option<UnmodMap.UnEntry<K,​V>> entry​(K key)
        Description copied from interface: BaseMap
        Returns an option of the key/value pair associated with this key
        Specified by:
        entry in interface BaseMap<K,​V>
      • getOrElse

        default V getOrElse​(K key,
                            V notFound)
        Specified by:
        getOrElse in interface BaseMap<K,​V>
      • subMap

        @NotNull
        @NotNull ImSortedMap<K,​V> subMap​(K fromKey,
                                               K toKey)
        Return the elements in this map from the start element (inclusive) to the end element (exclusive)
        Specified by:
        subMap in interface SortedMap<K,​V>
        Specified by:
        subMap in interface UnmodSortedMap<K,​V>
      • assoc

        @NotNull
        @NotNull ImSortedMap<K,​V> assoc​(K key,
                                              V val)
        Returns a new map with the given key/value added. If the key exists in this map, the new value overwrites the old one. If the key exists with the same value (based on the address of that value in memory, not an equals test), the old map is returned unchanged.
        Specified by:
        assoc in interface BaseMap<K,​V>
        Parameters:
        key - the key used to look up the value. In the case of a duplicate key, later values overwrite the earlier ones. The resulting map can contain zero or one null key (if your comparator knows how to sort nulls) and any number of null values.
        val - the value to store in this key.
        Returns:
        a new PersistentTreeMap of the specified comparator and the given key/value pairs
      • assoc

        @NotNull
        default @NotNull ImSortedMap<K,​V> assoc​(@NotNull
                                                      Map.Entry<K,​V> entry)
        Returns a new map with an immutable copy of the given entry added
        Specified by:
        assoc in interface BaseMap<K,​V>
      • without

        @NotNull
        @NotNull ImSortedMap<K,​V> without​(K key)
        Returns a new map with the given key/value removed
        Specified by:
        without in interface BaseMap<K,​V>