Code example for TreeMap

Methods: firstKey, put, remove, size

0
			meanings=new TreeMap<String,String>();
			maxSize=maxCacheSize;
		} 
		 
		public void add(String w,String m){
			meanings.put(w, m);
			if (meanings.size()>maxSize) meanings.remove(meanings.firstKey());
		} 
		 
		public String lookup(String w){
			return meanings.get(w);
		} 
	} 
	 
	private static class TopIndex{ 
		 
		private byte[][]wordBytes;
		private byte[][]offBytes;
		 
		 
		public TopIndex(InputStream in,int topSize,int topCount) throws IOException{