Code example for HashMap

Methods: put

0
		rect.left = (args[kArgX] != null) ? TiConvert.toFloat(args[kArgX]) : 0;
		rect.top = (args[kArgY] != null) ? TiConvert.toFloat(args[kArgY]) : 0;
		rect.right = rect.left + ((args[kArgWidth] != null) ? TiConvert.toFloat(args[kArgWidth]) : 0);
		rect.bottom = rect.top + ((args[kArgHeight] != null) ? TiConvert.toFloat(args[kArgHeight]) : 0);
 
		HashMap result = new HashMap();
		result.put("x", rect.left);
		result.put("y", rect.top);
		result.put("width", rect.width());
		result.put("height", rect.height());
		 
		Log.d(LCAT,"[METHODSDEMO] " + result);
		 
		return result;
	} 
	 
	@Kroll.method 
	public HashMap demoMethodPoint(Object[] args)
	{ 
		// This method is an example of exposing a native method that accepts 2 
		// integer values as arguments and returns an equivalent TiPoint object.