Code example for TreeMap

Methods: containsKey, get, put

0
	 * @return 
	 */ 
	public static TomitaClass getClass(String cName, double weight) {
		//TODO ïðîâåðêà íà äîïóñòèìûé âåñ [0..1] 
		if (classes == null) {
			classes = new TreeMap<String, TomitaClass>();
		} 
		TomitaClass c = null;
		if (classes.containsKey(cName)) {
			c = classes.get(cName);
		} 
		else if (weight >= 0) {
			c = new TomitaClass(weight);
			classes.put(cName, c);
		} 
		return c;
	} 
}