/*-----------------------------------------------------------------------
Classes JavaScript File

version: 	4.1
author:		sebastian kupke
email:		sebastian.kupke@baral-geohaus.de
website:	http://www.baral.de
-----------------------------------------------------------------------*/

/* =namespace classes
-----------------------------------------------------------------------*/
ws.cl = {
		
	/* =Point
	-----------------------------------------------------------------------*/
	Point: function(x, y) {
		this.x = x;
		this.y = y;
	},
		
	/* =Extent
	-----------------------------------------------------------------------*/
	Extent: function(minx, miny, maxx, maxy) {
		this.minx = minx;
		this.miny = miny;
		this.maxx = maxx;
		this.maxy = maxy;
	},
	
	/* =View
	-----------------------------------------------------------------------*/
	View: function(center, scale) {
		this.center = center;
		this.scale = scale;
	},
	
	/* =Hash
	-----------------------------------------------------------------------*/
	Hash: function() {
		this.length = 0;
		this.items = new Array();
		for (var i = 0; i < arguments.length; i += 2) {
			if (typeof(arguments[i + 1]) != 'undefined') {
				this.items[arguments[i]] = arguments[i + 1];
				this.length++;
			}
		}
	   
		this.remove = function(in_key) {
			var tmp_value;
			if (typeof(this.items[in_key]) != 'undefined') {
				this.length--;
				var tmp_value = this.items[in_key];
				delete this.items[in_key];
			}
		   
			return tmp_value;
		}

		this.get = function(in_key) {
			return this.items[in_key];
		}

		this.set = function(in_key, in_value) {
			if (typeof(in_value) != 'undefined') {
				if (typeof(this.items[in_key]) == 'undefined') {
					this.length++;
				}

				this.items[in_key] = in_value;
			}
		   
			return in_value;
		}

		this.has = function(in_key) {
			return typeof(this.items[in_key]) != 'undefined';
		}
	}
};













