JSDOC / coding standards for Util.Size

git-svn-id: http://svn.openlayers.org/trunk/openlayers@90 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-17 13:20:31 +00:00
parent 8b6348c7b2
commit f7b33fb581

View File

@@ -91,21 +91,58 @@ OpenLayers.Pixel.prototype = {
CLASS_NAME: "OpenLayers.Pixel"
};
/**
* @class This class represents a width and height pair
*/
OpenLayers.Size = Class.create();
OpenLayers.Size.prototype = {
initialize: function(w,h) {
this.w=w;
this.h=h;
/** @type float */
w: 0.0,
/** @type float */
h: 0.0,
/**
* @param {float} w
* @param {float} h
*/
initialize: function(w, h) {
this.w = w;
this.h = h;
},
toString:function(){
/**
* @return String representation of OpenLayers.Size object. (ex. "w=55,h=66")
* @type String
*/
toString:function() {
return ("w="+this.w+",h="+this.h);
},
copyOf:function(){
/**
* @return New OpenLayers.Size object with the same w and h values
* @type OpenLayers.Size
*/
copyOf:function() {
return new OpenLayers.Size(this.w, this.h);
},
sameSize:function(pt){
return (this.w==pt.w && this.h==pt.h);
/**
* @param {OpenLayers.Size} sz
* @returns Boolean value indicating whether the passed-in OpenLayers.Size
* object has the same w and h components as this
*
* @type bool
*/
equals:function(sz) {
return ((this.w == sz.w) && /this.h == sz.h));
}
/** @type String */
CLASS_NAME: "OpenLayers.Size"
};
OpenLayers.LatLon = Class.create();