It inserts the specified value with the specified key in the map. It removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty. It removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty. It returns a NavigableSet view of the keys contained in this map. It returns the greatest key strictly less than the given key, or null if there is no such key. It returns a key-value mapping associated with the greatest key strictly less than the given key, or null if there is no such key. It returns the key-value pair having the greatest key, or null if there is no such key. It returns the collection of keys exist in the map. It is used to return true if this map contains a mapping for the specified key. It returns the least key strictly greater than the given key, or null if there is no such key. It returns the key-value pairs whose keys are less than (or equal to if inclusive is true) toKey. NavigableMap headMap(K toKey, boolean inclusive) It returns the key-value pairs whose keys are strictly less than toKey. It performs the given action for each entry in the map until all entries have been processed or the action throws an exception. It returns the greatest key, less than or equal to the specified key, or null if there is no such key. It returns the key-value pair having the least key. It returns the specified key-value pairs in descending order. It returns a reverse order NavigableSet view of the keys contained in the map. It returns the comparator that arranges the key in order, or null if the map uses the natural ordering. It returns a shallow copy of TreeMap instance. It removes all the key-value pairs from a map. It returns the least key, greater than the specified key or null if there is no such key. It returns the key-value pair having the least key, greater than or equal to the specified key, or null if there is no such key. It is used to initialize a treemap with the entries from the SortedMap sm, which will be sorted in the same order as sm. It is used to initialize a treemap with the entries from m, which will be sorted using the natural order of the keys. It is used to construct an empty tree-based map that will be sorted using the comparator comp. It is used to construct an empty tree map that will be sorted using the natural order of its key. K: It is the type of keys maintained by this map.Ĭonstructors of Java TreeMap class Constructor.Returns a collection view of the values contained in this map.Public class TreeMap extends AbstractMap implements NavigableMap, Cloneable, Serializable Returns the number of key-value mappings in this map. Removes the mapping for this key from this map if present. These mappings will replace any mappings that this map had for any of the keys currently in the specified map. Returns a set view of the keys contained in this map.Īssociates the specified value with the specified key in this map.Ĭopies all of the mappings from the specified map to this map. Returns true if this map contains no key-value mappings. Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key. Returns a collection view of the mappings contained in this map. Returns true if this map maps one or more keys to the specified value. Returns true if this map contains a mapping for the specified key. Returns a shallow copy of this HashMap instance: the keys and values themselves are not cloned.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |