Skip to content

Tree Map

A Red-Black tree based NavigableMap implementation. The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time, depending on which constructor is used.

Diagram
operationtime complexityinfo
containsKeylog(n)checks whether a given key exists
getlog(n)finds a key
putlog(n)updates a key
removelog(n)remove a key
floorKeylog(n)returns greatest key less than or equal to given key
floorEntrylog(n)returns entry with greatest key less than or equal to given key
ceilingKeylog(n)returns least key greater than or equal to given key
ceilingEntrylog(n)returns entry with least key greater than or equal to given key
lowerKeylog(n)returns greatest key strictly less than given key
lowerEntrylog(n)returns entry with greatest key strictly less than given key
higherKeylog(n)returns least key strictly greater than given key
higherEntrylog(n)returns entry with least key strictly greater than given key
subMaplog(n)returns view of portion of map (view creation)
headMaplog(n)returns view of map with keys less than given key (view creation)
tailMaplog(n)returns view of map with keys greater than or equal to given key (view creation)
firstKeylog(n)returns first (lowest) key
firstEntrylog(n)returns entry with first (lowest) key
lastKeylog(n)returns last (highest) key
lastEntrylog(n)returns entry with last (highest) key
pollFirstEntrylog(n)removes and returns entry with first (lowest) key
pollLastEntrylog(n)removes and returns entry with last (highest) key
descendingMaplog(n)returns reverse order view of map (view creation)
descendingKeySetlog(n)returns reverse order view of keys (view creation)