Code example for TreeMap

Methods: containsKeyget

0
	/** 
	 *  
	 * @return 0 for normal content from cursor, 1 for header 
	 */ 
	public int getViewType(int pos) {
		if (headers.containsKey(pos))
			return headerType;
		else 
			return itemType;
	} 
 
	/** 
	 *  
	 * @return The header text for the current position. 
	 */ 
	public String getHeaderText() throws InputMismatchException {
		if (headerType == getViewType()) {
			return headers.get(position);
		} else { 
			throw new InputMismatchException("This item is not a header...");
		} 
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE