Tham khảo tài liệu 'java 6 platform revealed phần 3', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CHAPTER 2 LANGUAGE AND UTILITY UPDATES 29 MapGot January Offering January Offering January Remove tail Dec Offering January MapRemoving January MapGot February Offering February Offering February Remove tail Oct Offering February MapRemoving February MapGot July Offering July Offering July Remove tail Jan Offering July MapRemoving July MapGot Nov Offering Nov Offering Nov Remove tail Mar Offering Nov MapRemoving Nov Remove tail Jul Remove head Nov Remove tail August Remove head July Remove tail January Remove head February Remove tail null Note There are 23 combined names for months between short and long because May counts for both the short and long name of the fifth month. Since getDisplayNames returns a Map May can t be the key for two entries one short and one long. 30 CHAPTER 2 LANGUAGE AND UTILITY UPDATES Navigable Maps and Sets Yet another new piece of the Java Collections Framework is the new NavigableMap and NavigableSet interfaces. They extend the SortedMap and SortedSet interfaces respectively to essentially add search options to the interfaces. The NavigableMap Interface For NavigableMap there are essentially three sets of methods. One set of methods gets you submaps another set works with the map entries and the last set works with the map keys. There are three methods in the first set. To start with navigableHeadMap toKey returns a NavigableMap with all the keys up to but not including the toKey. Next there is navigableTailMap fromKey which returns a NavigableMap with all the keys starting with the fromKey inclusive to the end. Last there is navigableSubMap fromKey toKey which gives you a NavigableMap starting with the fromKey inclusive to the toKey exclusive. Always remember that the starting key is inclusive and the ending key is exclusive startKey endKey . Functionally these methods are the same as the headMap tailMap and subMap methods of SortedMap but return a different type NavigableMap instead. The second set of methods works with the keys of