public SortedMap headMap ( Object endKey ) { // Check for errors if ( comparator == null ) ( ( Comparable ) endKey ) . compareTo ( endKey ) ; else comparator . compare ( endKey , endKey ) ; return makeSubMap ( null , endKey ) ; }
Answers a SortedMap of the specified portion of this TreeMap which contains keys less than the end key . The returned SortedMap is backed by this TreeMap so changes to one are reflected by the other .