// Copyright 2008 ProjectWizards GmbH. All rights reserved.

//console.log("MEUtilisation.js");

var MEUtilisation = WRLObject.extend({
	constructor: function(json){
		this.base();
		this.amount = json.a == null || typeof(json.a) == "undefined" ? null : json.a;
		this.denominatorUnit = json.d == null || typeof(json.d) == "undefined" ? null : json.d;
	},

	className: "MEUtilisation",

	sortValue: function() {
		return this.amount;
	},

    toJSON: function() {
        return '{"a":' + this.amount + ', "d":' + this.denominatorUnit+'}';
    }
			
},{	
	utilisationWithAmountDenominatorUnit: function(amount, unit) {
		return new MEUtilisation({a:amount, d:unit});
	}
});