Monday, March 14, 2011

NavigableMap in JDK6

JDK6 introduced NavigableMap and retro-fitted TreeMap to implement this interface. I was a bit confused at first about ceilingKey vs higherKey and floorKey vs lowerKey. It turns out that floor and ceiling operations can return equal entries, while higher and lower operations must be strictly less than or greater than.


Nice features. I can definitely find some uses for them. :)