public function toJSONObject($names)
	{
		if(!is_array($names))
			throw new JSONException('Provided value must be an array');
		
		if($names == NULL || count($names) == 0 || $this->length() == 0)
		{
			return NULL;
		}
		
		$jsonObject = new JSONObject();
		
		foreach($this->map as $index => $value)
		{
			$jsonObject->put($value, $names[$index]);
		}
		
		return $jsonObject;
	}