0
1
Fork 0
hedera-web-mindshore/js/vn/model-iface.js

127 lines
2.7 KiB
JavaScript
Raw Permalink Normal View History

2022-05-30 01:30:33 +00:00
/**
* Readable data model.
*/
module.exports = new Class({
Properties: {
/**
* The number of rows in the model.
*/
numRows: {
type: Number
},
/**
* The current status of the model.
*/
status: {
type: Number
},
/**
* Checks if the model data is ready.
*/
ready: {
type: Boolean
}
}
/**
* Checks if the column exists.
*
* @param {integer} column The column index
* @return {boolean} %true if column exists, %false otherwise
*/
2022-11-16 01:46:44 +00:00
,checkColExists() {}
2022-05-30 01:30:33 +00:00
/**
* Checks if the row exists.
*
* @param {integer} rowIndex The row index
* @return {boolean} %true if row exists, %false otherwise
*/
2022-11-16 01:46:44 +00:00
,checkRowExists() {}
2022-05-30 01:30:33 +00:00
/**
* Get the index of the column from its name.
*
* @param {string} columnName The column name
* @return {number} The column index or -1 if column not exists
*/
2022-11-16 01:46:44 +00:00
,getColumnIndex() {}
2022-05-30 01:30:33 +00:00
/**
* Gets a value from the model.
*
* @param {number} rowIndex The row index
* @param {string} columnName The column name
* @return {*} The value, or %undefined
*/
2022-11-16 01:46:44 +00:00
,get() {}
2022-05-30 01:30:33 +00:00
/**
* Gets a value using the column index.
*
* @param {number} rowIndex The row index
* @param {number} column The column index
* @return {*} The value
*/
2022-11-16 01:46:44 +00:00
,getByIndex() {}
2022-05-30 01:30:33 +00:00
/**
* Gets a row as an object using the column index.
*
* @param {number} rowIndex The row index
* @return {Object} The row as an object
*/
2022-11-16 01:46:44 +00:00
,getObject() {}
2022-05-30 01:30:33 +00:00
/**
* Orders the model by the specified column name.
*
* @param {number} column The column name
* @param {SortWay} way The sort way
*/
2022-11-16 01:46:44 +00:00
,sortByName() {}
2022-05-30 01:30:33 +00:00
/**
* Orders the model by the specified column.
*
* @param {number} column The column index
* @param {SortWay} way The sort way
*/
2022-11-16 01:46:44 +00:00
,sort() {}
2022-05-30 01:30:33 +00:00
/**
* Searchs a value on the model and returns the row index of the first
* ocurrence.
* If an index have been built on that column, it will be used, for more
* information see the indexColumn() method.
*
* @param {string} column The column name
* @param {Object} value The value to search
* @return {number} The column index
*/
2022-11-16 01:46:44 +00:00
,search() {}
2022-05-30 01:30:33 +00:00
/**
* Searchs a value on the model and returns the row index of the first
* ocurrence.
*
* @param {number} col The column index
* @param {Object} value The value to search
* @return {number} The column index
*/
2022-11-16 01:46:44 +00:00
,searchByIndex() {}
2022-05-30 01:30:33 +00:00
/**
* Builds an internal hash index for the specified column, this speeds
* significantly searches on that column, specially when model has a lot of
* rows.
*
* FIXME: Not fully implemented.
*
* @param {string} column The column name
*/
2022-11-16 01:46:44 +00:00
,indexColumn() {}
2022-05-30 01:30:33 +00:00
});