/*
 * TODO: Copyright (c) 2007 Denis Morozov <dmorozov@exadel.com>
 *
 * ...
 */
ClientUILib.declarePackage("ClientUI.controls.grid.ArrayDataModel");

ClientUILib.requireClass("ClientUI.controls.grid.DataModel");
/*
 * ArrayDataModel.js - Array datamodel for grid control 
 * by Denis Morozov <dmorozov@exadel.com> distributed under the BSD license. 
 *
 */
ClientUI.controls.grid.ArrayDataModel = Class.create({
	CLASSDEF: {
		name: 'ClientUI.controls.grid.ArrayDataModel',
		parent: ClientUI.controls.grid.DataModel
	}
	
});

Object.extend(ClientUI.controls.grid.ArrayDataModel.prototype, {
	initialize: function(data) {
		this.parentClass().constructor().call(this);
		this.data = $A(data || []);
	},
	getRow: function(index) {
		return this.data[index];
	},
	getCount: function() {
		return this.data.length;
	},
	getRequestDelay: function() {
		return 50;
	}
});