hedera-web/js/sql/list-holder.js

61 lines
758 B
JavaScript
Raw Normal View History

2017-11-13 16:36:30 +00:00
/**
* Interface for array holders.
*/
module.exports = new Class
({
Properties:
{
2017-11-16 14:53:20 +00:00
/*
2017-11-13 16:36:30 +00:00
list:
{
type: Array
,set: function (x)
{
this._list = x;
}
,get: function ()
{
return this._list;
}
}
2017-11-16 14:53:20 +00:00
*/
2017-11-13 16:36:30 +00:00
}
2017-11-16 14:53:20 +00:00
,list: []
2017-11-13 16:36:30 +00:00
,appendChild: function (child)
{
2017-11-16 14:53:20 +00:00
this.list.push (child);
2017-11-13 16:36:30 +00:00
}
/**
* Adds an element to the list.
*
* @param {SqlObject} element The element to add
*/
,push: function (element)
{
2017-11-16 14:53:20 +00:00
this.list.push (element);
2017-11-13 16:36:30 +00:00
}
/**
* Removes an element from the list.
*
* @param {Number} i The element index
*/
,splice: function (i)
{
2017-11-16 14:53:20 +00:00
this.list.splice (i);
2017-11-13 16:36:30 +00:00
}
/**
* Adds an element to the list.
*
* @param {Number} i The element index
*/
,get: function (i)
{
2017-11-16 14:53:20 +00:00
return this.list[i];
2017-11-13 16:36:30 +00:00
}
});