Skip to content
Reference > Classes

TableSet

Definition

TableSet var = .... ;

Extends

Extended By

None

Description

Represents a set of named tables. Tables can be added or removed. This data structure represents the requests and responses to/from a datamodel

Method Summary

Owner Name Return Type Description
TableSet clear() Boolean Clears the tables. Returns true if the tableset is changed as a result.
TableSet exists(tableName) Boolean Returns true if the table supplied exists in this tableset.
TableSet get(tableName) Table Returns a table from this tableset or null if table is not found.
Object getClassName() String Returns the string name of this object's class type.
TableSet getNames() Set Returns a set of table names in the tableset.
TableSet getRowsCount(tableName) Integer Returns the number of rows for the given table, or -1 if table not found.
TableSet put(tableName, table) Object Sets or replaces a table on this tableset. Returns the replaced table or null if there was an error.
TableSet query(amiSql) Object Runs the specified AmiSql on this set of tables. Returns the resulting table.
TableSet remove(tableName) Object Removes a table from this tableset. Returns the removed table or null if table is not found.
Object toJson() String Returns a json representation of this object.

Method Definitions


clear()

Boolean TableSet::clear()

Description

Clears the tables. Returns true if the tableset is changed as a result.


exists(tableName)

Boolean TableSet::exists(String tableName)

Description

Returns true if the table supplied exists in this tableset.

Parameter Definition

Name Type Description
tableName String  name of the table to check for existence

get(tableName)

Table TableSet::get(Object tableName)

Description

Returns a table from this tableset or null if table is not found.

Parameter Definition

Name Type Description
tableName Object  name of the table to get

getNames()

Set TableSet::getNames()

Description

Returns a set of table names in the tableset.


getRowsCount(tableName)

Integer TableSet::getRowsCount(String tableName)

Description

Returns the number of rows for the given table, or -1 if table not found.

Parameter Definition

Name Type Description
tableName String  name of the table

put(tableName,table)

Object TableSet::put(String tableName, Table table)

Description

Sets or replaces a table on this tableset. Returns the replaced table or null if there was an error.

Parameter Definition

Name Type Description
tableName String  name of the table to add
table Table  table to add

query(amiSql)

Object TableSet::query(String amiSql)

Description

Runs the specified AmiSql on this set of tables. Returns the resulting table.

Parameter Definition

Name Type Description
amiSql String  amiSql to run

remove(tableName)

Object TableSet::remove(String tableName)

Description

Removes a table from this tableset. Returns the removed table or null if table is not found.

Parameter Definition

Name Type Description
tableName String  name of the table to remove