[Mapbender-commits] r1327 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon May 21 05:54:09 EDT 2007


Author: christoph
Date: 2007-05-21 05:54:09 -0400 (Mon, 21 May 2007)
New Revision: 1327

Modified:
   trunk/mapbender/http/javascripts/geometry.js
Log:
moved class List to map.php

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2007-05-21 09:53:23 UTC (rev 1326)
+++ trunk/mapbender/http/javascripts/geometry.js	2007-05-21 09:54:09 UTC (rev 1327)
@@ -25,109 +25,6 @@
 
 
 /**
- * @class A List object is an array of arbitrary objects with additional methods. 
- *
- * @constructor
- */
-var List = function() {
-	
-	/**
-	 * gets the number of elements in this {@link List}
-	 *
-	 * @member List
-	 * @returns number of elements in this {@link List}
-	 * @type Integer
-	 */
-	this.count = function() {
-		return this.list.length;
-	};
-
-	/**
-	 * deletes the object at index i; -1 refers to the last object in this {@link List}
-	 *
-	 * @member List
-	 * @param {Integer} i index
-	 */
-	this.del = function(i){
-		i = this.getIndex(i);
-		for(var z = i; z < this.count() - 1; z++){
-			this.list[z] = this.list[z+1];
-		}
-		this.list.length -= 1;
-	};
-
-	/**
-	 * @member List
-	 * @param {Integer} i index
-	 * @returns the object at index i; -1 refers to the last object in this {@link List}
-	 * @type Integer or false
-	 */
-	this.get = function(i) {
-		i = this.getIndex(i);
-		if (i !== false) {return this.list[i];}
-		return false;		
-	};
-	/**
-	 * adds a reference to item to this {@link List}.
-	 *
-	 * @member List
-	 * @param {Object} item an object
-	 */
-	this.add = function(item) {
-		this.list.push(item);
-	};
-	/**
-	 * adds a copy of item to this {@link List}.
-	 *
-	 * @member List
-	 * @param {Object} item an object
-	 */
-	this.addCopy = function(item) {
-		this.list.push(cloneObject(item));
-	};
-	/**
-	 * attaches the {@link List} aList to this {@link List}
-	 *
-	 * @member List
-	 * @param {List} aList another list
-	 */
-	this.union = function(aList) {
-		for (var i=0; i < aList.count(); i++) {this.addCopy(aList.get(i));}
-	};
-	/**
-	 * checks if the index is valid and returns it if it is; if i == -1, the correct index is retrieved.
-	 *
-	 * @member List
-	 * @private
-	 * @return Integer or false
-	 * @type Integer
-	 */
-	this.getIndex = function(i){ 
-		if ((i >= 0 && i < this.list.length) || (i*(-1)>0 && i*(-1) <= this.list.length)){
-			if (i >= 0) {return i;} else {return this.list.length+i;}
-		}
-		else {
-			var e = new Mb_exception("class List: function getIndex: member index " + i + " is not valid");
-			return false;
-		}
-	};
-	/**
-	 * @member List
-	 * @returns a {String} representation of this List
-	 * @type String
-	 */
-	this.toString = function(){
-		var str = "";
-		for (var i =0 ; i < this.count() ; i++){
-			str += this.get(i).toString();
-		}
-		return str;	
-	};	
-	
-	this.list = null;
-};
-
-/**
  * @class a {@link GeometryArray} is a {@link List} of {@link MultiGeometry} objects
  *
  * @ extends List



More information about the Mapbender_commits mailing list