Interface ImSortedMap<K,​V>

    • Method Detail

      • containsKey

        default boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface BaseMap<K,​V>
        Specified by:
        containsKey in interface java.util.Map<K,​V>
      • entrySet

        ImSortedSet<java.util.Map.Entry<K,​V>> entrySet()
        Returns a view of the mappings contained in this map. The set should actually contain UnmodMap.Entry items, but that return signature is illegal in Java, so you'll just have to remember.
        Specified by:
        entrySet in interface BaseMap<K,​V>
        Specified by:
        entrySet in interface java.util.Map<K,​V>
        Specified by:
        entrySet in interface java.util.SortedMap<K,​V>
        Specified by:
        entrySet in interface UnmodMap<K,​V>
        Specified by:
        entrySet in interface UnmodSortedMap<K,​V>
      • get

        default V get​(java.lang.Object key)
        Specified by:
        get in interface BaseMap<K,​V>
        Specified by:
        get in interface java.util.Map<K,​V>
      • getOrElse

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

        default ImSortedMap<K,​V> headMap​(K toKey)
        Return the elements in this map up (but excluding) to the given element
        Specified by:
        headMap in interface java.util.SortedMap<K,​V>
        Specified by:
        headMap in interface UnmodSortedMap<K,​V>
      • keySet

        default ImSortedSet<K> keySet()
        Returns a view of the keys contained in this map.
        Specified by:
        keySet in interface BaseMap<K,​V>
        Specified by:
        keySet in interface java.util.Map<K,​V>
        Specified by:
        keySet in interface java.util.SortedMap<K,​V>
        Specified by:
        keySet in interface UnmodMap<K,​V>
        Specified by:
        keySet in interface UnmodSortedMap<K,​V>
      • subMap

        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 java.util.SortedMap<K,​V>
        Specified by:
        subMap in interface UnmodSortedMap<K,​V>
      • tailMap

        ImSortedMap<K,​V> tailMap​(K fromKey)
        Return the elements in this from the given element to the end
        Specified by:
        tailMap in interface java.util.SortedMap<K,​V>
        Specified by:
        tailMap in interface UnmodSortedMap<K,​V>
      • assoc

        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

        default ImSortedMap<K,​V> assoc​(java.util.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

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