Transaction System API

PacketDataList extends DataList

This class also used in (click to expand):
Method Summary
boolean addColumn(String column)

Adds the specified column to the end of this DataList. If the column already exists, this method returns false.

boolean addColumn(String column, String defaultValue)

Adds the specified column to the end of this DataList and sets the value for all rows in the list. If the column already exists, this method returns false.

  addColumns(String[] columns)

Adds the new columns to this list.

  addColumns(String[] columns, String arg2)

Adds the new columns to this list and sets the default value.

PacketDataList addDataList(String name, DataList dataList)

Combines the given DataList with this one in a new DataList. Columns that match the names of this DataList are included and others are omited.

  addJSONDataList(String jsonDataList)

Decodes the JSON serialized DataList and adds it to this DataList.

  addJSONRecords(String property, String jsonString)

Decodes the JSON string and adds the content to this DataList object. Expects a property of a larger JSON object that contains an array of objects.

  appendList(DataList dataList)

Appends the list and any new columns to this list

DataList applyFilter(DataListFilter filter)

Returns a new DataList with records from this list that match the filter.

PacketDataList bubble(String name, String idColumn, String idDelim, String countColumn, String xColumn, String yColumn, boolean relative)

Performs an aggregation on the data elements of this list and returns a list suitable for use in bubble charts.

String calcMD5()

Returns an MD5 checksum of the contents of this list.

PacketDataList collapse(String keyId, String[] keyColumns, String listColumn, String[] listColumns)

Reduces a list with duplicate data into a list with unique data adding a new serialized JSON column containing the duplicate information. See also tag c:expand.

PacketDataList copy(String name)

Creates a new PacketDataList from this DataList.

DataListFilter createAndFilter()

Creates an empty DataListFilter based on this DataList. Filter will return records matching all constraints.

DataListFilter createOrFilter()

Creates an empty DataListFilter based on this DataList. Filter will return records matching any constraints.

Payload createSublists(String prefix, int listSize)

Returns a Payload containing one or more lists named prefixN (starting with 1) with a list called prefix containing the names of the lists created.

  deleteAllRecords()

Deletes all records.

  deleteColumns(String[] columns)

Deletes the specified columns from this list.

  deleteRecord(int row)

Deletes the record at the specified index.

  deleteRecords(DataListFilter filter)

Deletes records matching specified filter.

int deleteRecords(String column, String value)

Deletes all records that have the specified value in the given column

DataRecord findRecord(DataListFilter filter)

Finds the first record matching the given filter. Returns null if no matching record found.

PacketDataRecord findRecord(DataListFilter filter)

Finds the first record matching the given filter. Returns null if no matching record found.

PacketDataRecord findRecord(String column, String value)

Returns the first record whose column matches the given value.

DataRecord findRecord(String column, String value)

Returns the first record whose column matches the given value.

PacketDataList flatten(String keyId)

Reduces a list with duplicate data into a list with unique data with later rows filling in empty values in prior rows that match the key.

PacketDataList flatten(String[] key, String countColumn)

Reduces a list with duplicate data into a list with unique data with later rows filling in empty values in prior rows that match the multi-value key. An optional countColumn can be created which represents the number of times the composite key was encountered.

int getColumnCount()

Returns the column count for this list

String[] getColumnNames()

Returns the columns of this DataList

DataList getColumns()

Returns the column names of this DataList as a DataList.

String getName()

Returns the name of this list

PacketDataRecord getRecord(int index)

Returns the record at the specified index

DataRecord getRecord(int index)

Returns the record at the specified index

int getRecordCount()

Returns the number of records in this list

double getTotal(String column, double defaultValue)

Returns the total of the given column. If the value of the individual record cannot compute to a double, defaultValue is used.

int getTotalRecordCount(DataListFilter filter)

Returns the total count of records that match the DataListFilter.

PacketDataRecord insertRecord()

Creates a new (empty) record and returns it.

boolean isReadOnly()

Returns true if this is a read-only list

PacketDataList joinDataList(String name, String joinColumn, DataList dataList)

Joins the DataList with this one into a new DataList that is joined by the joinColumn and that has the columns of both data lists.

PacketDataList mergeDataList(String name, DataList dataList, String indexColumn)

Merges the DataList with this one into a new DataList using an indexed column. All records in this list are kept but the values that match the index column are replaced by those in the supplied dataList. The index column should contain unique values representing a 1:1 relationship between the two lists.

PacketDataList pivot(String key, String pivot, String amt, String op)

Returns a new list with the key, the same name with columns specified by the pivot values, and the key+'Total' on the specified operation. The amt column must be numeric and maximum columns is 100.

  removeColumn(String column)

Removes the specified column.

  renameColumn(String oldColumnName, String newColumnName)

Renames the specified column.

  renameColumns(String[] newColumnNames)

Renames all of the columns. The column length must match the existing number of columns.

boolean setColumnValue(String column, Date value)

Sets the value of the specified date column referenced by name for all records. Returns false if the column does not exist.

boolean setColumnValue(String column, String value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

boolean setColumnValue(String column, boolean value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

boolean setColumnValue(String column, double value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

boolean setColumnValue(String column, int value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

boolean setColumnValue(String column, long value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

  setName(String name)

Sets the name of this list.

PacketDataList split(String name, String[] columns)

Returns a new datalist containing only those columns specified.

PacketDataList sublist(String name, int start, int end)

Creates a new PacketDataList from this DataList with the range of records specified. Returns an empty list if no more records within the range.

String[] toArray(String columnName)

Returns the values of the specified column as an array. Throws exception if the column does not exist.

Data toData(String keyColumn, String valueColumn, boolean addNullValues)

Creates a Data object with keys coming from key column and values from value column. Overwrites any keys that are duplicated. Returns null if the keyColumn or valueColumn does not exist. If addNullValues is true then null values will be added as empty string.

File toFile(String fileName, String delim)

Creates csv/pipe/tab delimited file from data list. File will reflect current datalist state. Further modifications of datalist will not have effect on file contents. File limit is controlled by the max data export size of the activation key.

String toJSON(boolean compressDataList)

Returns contents as a JSON string.

String toJsonArray(boolean includeNull, Data typeMap)

Returns contents as a JSON Array string. An optional key map should have field name types defined as string, int, long, double, boolean, or date. This method is limited by the max export size of the activation key.

String toString()

Returns a description of this object.

Method Detail


boolean addColumn(String column)

Adds the specified column to the end of this DataList. If the column already exists, this method returns false.

Parameters:

  • String   column

Returns:  boolean

Since: 11-19-2009

top

boolean addColumn(String column, String defaultValue)

Adds the specified column to the end of this DataList and sets the value for all rows in the list. If the column already exists, this method returns false.

Parameters:

  • String   column Required parameter.
  • String   defaultValue

Returns:  boolean

Since: 04-24-2018

top

addColumns(String[] columns)

Adds the new columns to this list.

Parameters:

  • String[]   columns Required parameter.

Since: 06-01-2021

top

addColumns(String[] columns, String arg2)

Adds the new columns to this list and sets the default value.

Parameters:

  • String[]   columns Required parameter.
  • String   arg2

Since: 06-01-2021

top

PacketDataList addDataList(String name, DataList dataList)

Combines the given DataList with this one in a new DataList. Columns that match the names of this DataList are included and others are omited.

Parameters:

Returns:  PacketDataList

Since: 01-19-2009

top

addJSONDataList(String jsonDataList)

Decodes the JSON serialized DataList and adds it to this DataList.

Parameters:

  • String   jsonDataList Required parameter.

Since: 10-07-2010

top

addJSONRecords(String property, String jsonString)

Decodes the JSON string and adds the content to this DataList object. Expects a property of a larger JSON object that contains an array of objects.

Parameters:

  • String   property Required parameter.
  • String   jsonString Required parameter.

Since: 01-19-2010

top

appendList(DataList dataList)

Appends the list and any new columns to this list

Parameters:

Since: 08-07-2019

top

DataList applyFilter(DataListFilter filter)

Returns a new DataList with records from this list that match the filter.

Parameters:

Returns:  DataList

Since: 01-19-2009

top

PacketDataList bubble(String name, String idColumn, String idDelim, String countColumn, String xColumn, String yColumn, boolean relative)

Performs an aggregation on the data elements of this list and returns a list suitable for use in bubble charts.

Parameters:

  • String   name  - Name of the list to be returned. Required parameter.
  • String   idColumn  - Name of the column in this list that contains labels.
  • String   idDelim  - Delimiter to use if you specify an idColumn. Default is comma [,]..
  • String   countColumn  - Name of column to store the count. This column cannot already exist in the DataList.. Required parameter.
  • String   xColumn  - Name of the column in the DataList containing numbers to analyze for the X-Axis. Required parameter.
  • String   yColumn  - Name of the column in the DataList containing numbers to analyze for the Y-Axis. Required parameter.
  • boolean   relative  - If true, all buckets will be relative to the maximum entry of each column. Otherwise all buckets are relative to the sum of all values in the columns. Default is false.. Required parameter.

Returns:  PacketDataList

Since: 07-01-2011

top

String calcMD5()

Returns an MD5 checksum of the contents of this list.

Returns:  String

Since: 05-15-2014

top

PacketDataList collapse(String keyId, String[] keyColumns, String listColumn, String[] listColumns)

Reduces a list with duplicate data into a list with unique data adding a new serialized JSON column containing the duplicate information. See also tag c:expand.

Parameters:

  • String   keyId Required parameter.
  • String[]   keyColumns Required parameter.
  • String   listColumn Required parameter.
  • String[]   listColumns Required parameter.

Returns:  PacketDataList

Since: 03-28-2019

top

PacketDataList copy(String name)

Creates a new PacketDataList from this DataList.

Parameters:

  • String   name

Returns:  PacketDataList

Since: 11-19-2009

top

DataListFilter createAndFilter()

Creates an empty DataListFilter based on this DataList. Filter will return records matching all constraints.

Returns:  DataListFilter

Since: 01-13-2009

top

DataListFilter createOrFilter()

Creates an empty DataListFilter based on this DataList. Filter will return records matching any constraints.

Returns:  DataListFilter

Since: 01-13-2009

top

Payload createSublists(String prefix, int listSize)

Returns a Payload containing one or more lists named prefixN (starting with 1) with a list called prefix containing the names of the lists created.

Parameters:

  • String   prefix  - Prefix name for all sublists and index list.. Required parameter.
  • int   listSize  - How many records to include in each sub list.. Required parameter.

Returns:  Payload

Since: 05-15-2014

top

deleteAllRecords()

Deletes all records.

Since: 11-21-2013

top

deleteColumns(String[] columns)

Deletes the specified columns from this list.

Parameters:

  • String[]   columns Required parameter.

Since: 06-01-2021

top

deleteRecord(int row)

Deletes the record at the specified index.

Parameters:

  • int   row

Since: 08-01-2007

top

deleteRecords(DataListFilter filter)

Deletes records matching specified filter.

Parameters:

Since: 09-11-2009

top

int deleteRecords(String column, String value)

Deletes all records that have the specified value in the given column

Parameters:

  • String   column Required parameter.
  • String   value

Returns:  int

Since: 01-06-2015

top

DataRecord findRecord(DataListFilter filter)

Finds the first record matching the given filter. Returns null if no matching record found.

Parameters:

Returns:  DataRecord

Since: 05-17-2012

top

PacketDataRecord findRecord(DataListFilter filter)

Finds the first record matching the given filter. Returns null if no matching record found.

Parameters:

Returns:  PacketDataRecord

Since: 05-17-2012

top

PacketDataRecord findRecord(String column, String value)

Returns the first record whose column matches the given value.

Parameters:

  • String   column
  • String   value

Returns:  PacketDataRecord

Since: 01-28-2010

top

DataRecord findRecord(String column, String value)

Returns the first record whose column matches the given value.

Parameters:

  • String   column
  • String   value

Returns:  DataRecord

Since: 01-28-2010

top

PacketDataList flatten(String keyId)

Reduces a list with duplicate data into a list with unique data with later rows filling in empty values in prior rows that match the key.

Parameters:

  • String   keyId Required parameter.

Returns:  PacketDataList

Since: 08-07-2019

top

PacketDataList flatten(String[] key, String countColumn)

Reduces a list with duplicate data into a list with unique data with later rows filling in empty values in prior rows that match the multi-value key. An optional countColumn can be created which represents the number of times the composite key was encountered.

Parameters:

  • String[]   key Required parameter.
  • String   countColumn

Returns:  PacketDataList

Since: 06-29-2023

top

int getColumnCount()

Returns the column count for this list

Returns:  int

Since: 07-11-2008

top

String[] getColumnNames()

Returns the columns of this DataList

Returns:  String[]

Since: 01-19-2009

top

DataList getColumns()

Returns the column names of this DataList as a DataList.

Returns:  DataList


DataList Name: columns
DataList Fields: name

Since: 02-16-2011

top

String getName()

Returns the name of this list

Returns:  String

Since: 07-11-2008

top

PacketDataRecord getRecord(int index)

Returns the record at the specified index

Parameters:

  • int   index

Returns:  PacketDataRecord

Since: 07-11-2008

top

DataRecord getRecord(int index)

Returns the record at the specified index

Parameters:

  • int   index

Returns:  DataRecord

Since: 07-11-2008

top

int getRecordCount()

Returns the number of records in this list

Returns:  int

Since: 07-11-2008

top

double getTotal(String column, double defaultValue)

Returns the total of the given column. If the value of the individual record cannot compute to a double, defaultValue is used.

Parameters:

  • String   column
  • double   defaultValue

Returns:  double

Since: 09-23-2008

top

int getTotalRecordCount(DataListFilter filter)

Returns the total count of records that match the DataListFilter.

Parameters:

Returns:  int

Since: 03-25-2009

top

PacketDataRecord insertRecord()

Creates a new (empty) record and returns it.

Returns:  PacketDataRecord

Since: 08-01-2007

top

boolean isReadOnly()

Returns true if this is a read-only list

Returns:  boolean

Since: 08-16-2007

top

PacketDataList joinDataList(String name, String joinColumn, DataList dataList)

Joins the DataList with this one into a new DataList that is joined by the joinColumn and that has the columns of both data lists.

Parameters:

  • String   name
  • String   joinColumn
  • DataList   dataList

Returns:  PacketDataList

Since: 03-03-2009

top

PacketDataList mergeDataList(String name, DataList dataList, String indexColumn)

Merges the DataList with this one into a new DataList using an indexed column. All records in this list are kept but the values that match the index column are replaced by those in the supplied dataList. The index column should contain unique values representing a 1:1 relationship between the two lists.

Parameters:

  • String   name
  • DataList   dataList
  • String   indexColumn

Returns:  PacketDataList

Since: 01-19-2009

top

PacketDataList pivot(String key, String pivot, String amt, String op)

Returns a new list with the key, the same name with columns specified by the pivot values, and the key+'Total' on the specified operation. The amt column must be numeric and maximum columns is 100.

Parameters:

  • String   key Required parameter.
  • String   pivot Required parameter.
  • String   amt Required parameter.
  • String   op Required parameter. Allowed values: sum, avg, max, min, count.

Returns:  PacketDataList

Since: 10-30-2019

top

removeColumn(String column)

Removes the specified column.

Parameters:

  • String   column Required parameter.

Since: 05-10-2018

top

renameColumn(String oldColumnName, String newColumnName)

Renames the specified column.

Parameters:

  • String   oldColumnName Required parameter.
  • String   newColumnName Required parameter.

Since: 02-01-2011

top

renameColumns(String[] newColumnNames)

Renames all of the columns. The column length must match the existing number of columns.

Parameters:

  • String[]   newColumnNames Required parameter.

Since: 02-01-2011

top

boolean setColumnValue(String column, Date value)

Sets the value of the specified date column referenced by name for all records. Returns false if the column does not exist.

Parameters:

  • String   column
  • Date   value

Returns:  boolean

Since: 01-05-2010

top

boolean setColumnValue(String column, String value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

Parameters:

  • String   column
  • String   value

Returns:  boolean

Since: 01-05-2010

top

boolean setColumnValue(String column, boolean value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

Parameters:

  • String   column
  • boolean   value

Returns:  boolean

Since: 01-05-2010

top

boolean setColumnValue(String column, double value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

Parameters:

  • String   column
  • double   value

Returns:  boolean

Since: 01-05-2010

top

boolean setColumnValue(String column, int value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

Parameters:

  • String   column
  • int   value

Returns:  boolean

Since: 01-05-2010

top

boolean setColumnValue(String column, long value)

Sets the value of the specified column referenced by name for all records. Returns false if the column does not exist.

Parameters:

  • String   column
  • long   value

Returns:  boolean

Since: 01-05-2010

top

setName(String name)

Sets the name of this list.

Parameters:

  • String   name

Since: 07-11-2008

top

PacketDataList split(String name, String[] columns)

Returns a new datalist containing only those columns specified.

Parameters:

  • String   name  - Name of the new datalist. Required parameter.
  • String[]   columns  - Name of the columns to include in the new list.. Required parameter.

Returns:  PacketDataList

Since: 06-01-2021

top

PacketDataList sublist(String name, int start, int end)

Creates a new PacketDataList from this DataList with the range of records specified. Returns an empty list if no more records within the range.

Parameters:

  • String   name  - Name of new datalist.. Required parameter.
  • int   start  - Start record, 1 based, inclusive.. Required parameter.
  • int   end  - End record, 1 based, inclusive.. Required parameter.

Returns:  PacketDataList

Since: 01-20-2011

top

String[] toArray(String columnName)

Returns the values of the specified column as an array. Throws exception if the column does not exist.

Parameters:

  • String   columnName Required parameter.

Returns:  String[]

Since: 06-05-2013

top

Data toData(String keyColumn, String valueColumn, boolean addNullValues)

Creates a Data object with keys coming from key column and values from value column. Overwrites any keys that are duplicated. Returns null if the keyColumn or valueColumn does not exist. If addNullValues is true then null values will be added as empty string.

Parameters:

  • String   keyColumn
  • String   valueColumn
  • boolean   addNullValues

Returns:  Data

Since: 10-06-2009

top

File toFile(String fileName, String delim)

Creates csv/pipe/tab delimited file from data list. File will reflect current datalist state. Further modifications of datalist will not have effect on file contents. File limit is controlled by the max data export size of the activation key.

Parameters:

  • String   fileName  - File name. Name should have either csv,txt,tsv or dat extension, otherwise csv extension will be automatically appended. Required parameter. Maximum allowed size of parameter: 64
  • String   delim Required parameter. Allowed values: csv, pipe, tab.

Returns:  File

Since: 11-02-2010

top

String toJSON(boolean compressDataList)

Returns contents as a JSON string.

Parameters:

  • boolean   compressDataList Required parameter.

Returns:  String

Since: 08-30-2010

top

String toJsonArray(boolean includeNull, Data typeMap)

Returns contents as a JSON Array string. An optional key map should have field name types defined as string, int, long, double, boolean, or date. This method is limited by the max export size of the activation key.

Parameters:

  • boolean   includeNull Required parameter.
  • Data   typeMap

Returns:  String

Since: 09-16-2020

top

String toString()

Returns a description of this object.

Returns:  String

Since: 01-19-2009

top
Copyright © 2006 - 2024, ContractPal, Inc. All rights reserved. API Date: May 01, 2024 05:15 AM