Code example for TreeMap

Methods: clear, size

0
	public TreeMapAutoCompleteSupport() { 
		map = new TreeMap<String, String>();
	} 
	 
	public void addDocuments(List<Document> documents) {
		if (map.size() > MAX_NUMBER_OF_ENTRIES) {
			map.clear();
		} 
	} 
 
	public void addEntry(Entry entry) {
		if (!entry.getDescription().isEmpty()) {
			map.put(entry.getAccountId() + entry.getDescription().toLowerCase(),
					entry.getDescription());
		} 
	} 
	 
	public void clear() { 
		map.clear();
	}