Code example for TreeMap

Methods: lastKey

0
	 * @return map.entry 
	 */ 
	 
	public Entry<Integer, Event> getNextEvent(int time) {
		// last key? 
		if (time > events.lastKey()) return null;
		 
		HashMap<Integer, Event> map = new HashMap<Integer, Event>(1);
		map.put(ceilingKey(time), events.get(ceilingKey(time)));
		return map.entrySet().iterator().next();
	}	 
	 
	/** 
	 * returns the entry set itself 
	 * @return Set<Map.Entry<Integer,Event>> set of events 
	 */ 
	public Set<Map.Entry<Integer,Event>> getEntrySet() {
		return events.entrySet();
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE