public class DataSet
extends java.util.ArrayList
implements java.io.Serializable, com.labvantage.sapphire.gwt.shared.JSONable
Modifier and Type | Class and Description |
---|---|
static interface |
DataSet.ResultSetRowProcessor |
Modifier and Type | Field and Description |
---|---|
static int |
CLOB |
static int |
DATE
Constant indicating an Date column/data type.
|
static int |
FAILURE |
static int |
NULLNUMBER |
static int |
NUMBER
Constant indicating a Numeric column/data type.
|
static int |
STRING
Constant indicating a String column/data type.
|
static int |
SUCCESS |
static int |
UNKNOWN
Constant indicating an unknown column/data type.
|
Constructor and Description |
---|
DataSet()
Constructs a new empty DataSet.
|
DataSet(com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
Constructs a new empty DataSet with Locale and TimeZone set according to ConnectionInfo.
|
DataSet(org.json.JSONObject job) |
DataSet(java.util.Locale locale,
java.util.TimeZone timezone)
Deprecated.
Use the DataSet( ConnectionInfo ) constructor instead
|
DataSet(java.sql.ResultSet rs)
Constructs a new DataSet based on a JDBC resultset.
|
DataSet(java.sql.ResultSet rs,
com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
Constructs a new DataSet based on a JDBC resultset.
|
DataSet(java.sql.ResultSet rs,
java.util.Locale locale,
java.util.TimeZone timezone)
Deprecated.
Use the DataSet( ResultSet, ConnectionInfo ) constructor instead
|
DataSet(java.lang.String xml)
Constructs a new DataSet based on a XML string.
|
DataSet(java.lang.String xml,
com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
Constructs a new DataSet based on a XML string.
|
DataSet(java.lang.String xml,
java.util.Locale locale,
java.util.TimeZone timezone)
Deprecated.
Use the DataSet( xml, ConnectionInfo ) constructor instead
|
DataSet(java.lang.String columnnames,
java.lang.String rowdata)
Constructs a new DataSet based on two strings, one containing column names (semi-colon delimted) and
one containing the data (pipe and semicolon delimited).
|
Modifier and Type | Method and Description |
---|---|
boolean |
addColumn(java.lang.String columnid,
int type)
Adds a blank column.
|
boolean |
addColumn(java.lang.String columnid,
int type,
int length)
Adds a blank column.
|
boolean |
addColumnValues(java.lang.String columnid,
int type,
java.lang.String valueslist,
java.lang.String delimeter)
Used to simultaneously add a column and a list of values.
|
boolean |
addColumnValues(java.lang.String columnid,
int type,
java.lang.String valueslist,
java.lang.String delimeter,
java.lang.String defaultvalue)
Used to simultaneously add a column and a list of values.
|
int |
addRow()
Adds a blank row to the end of the dataset.
|
int |
addRow(int newrow)
Adds a blank row before the specifiedrow in the dataset.
|
DataSet |
copy()
Return a copy of the dataset object with no references to this object.
|
DataSet |
copy(java.lang.String[] columns,
boolean includeClobs)
Return a copy of the dataset object with no references to this object.
|
void |
copyRow(DataSet from,
int copyrow,
int copies)
Copies a row in a different dataset 'n' times.
|
void |
copyRow(int copyrow,
int copies)
Copies a row in the dataset 'n' times.
|
void |
deleteRow(int row)
Deletes a specific row.
|
int |
findRow(java.util.HashMap findmap)
Returns the row number of the first row found matching a specified find HashMap.
|
int |
findRow(java.util.HashMap findmap,
int start)
Returns the row number of the first row found matching a specified find HashMap.
|
int |
findRow(java.lang.String find)
Deprecated.
This method fails to find the row if any column value contains comma,
hence it is recommended to use findRow(HashMap findMap) for multiple column-value pairs and for single column-value pair use findRow(String, String).
|
int |
findRow(java.lang.String columnId,
java.lang.String value)
Returns the row number of the first row found matching with the value specified with the column.
|
java.math.BigDecimal |
getBigDecimal(int row,
java.lang.String columnid)
Get a BigDecimal value from a Numeric column.
|
java.math.BigDecimal |
getBigDecimal(int row,
java.lang.String columnid,
java.math.BigDecimal defaultvalue)
Get a BigDecimal value from a Numeric column with a default value if the BigDecimal is null.
|
java.util.Calendar |
getCalendar(int row,
java.lang.String columnid)
Get a Calendar object from a Date column.
|
java.util.Calendar |
getCalendar(int row,
java.lang.String columnid,
java.util.Calendar defaultvalue)
Get a Calendar object from a Date column with a default value if the value is null.
|
java.lang.String |
getCdataEscape()
get the CDATA escape sequence that was used when calling toXML() on the DataSet
|
java.lang.String |
getClob(int row,
java.lang.String columnid)
Get a string value from a Clob column.
|
java.lang.String |
getClob(int row,
java.lang.String columnid,
java.lang.String defaultvalue)
Get a string value from a Clob column with a default value if the string is null (or empty).
|
boolean |
getColidCaseSensitive()
Return whether the dataset object treats columnid as case sensitive.
|
int |
getColumnCount()
Returns the number of columns.
|
java.lang.String |
getColumnId(int col)
Returns the Id (Name) of the specified column number.
|
int |
getColumnLength(java.lang.String columnid)
Returns the column length if DataSet.STRING type and from a java.sql.ResultSet.
|
java.lang.String[] |
getColumns()
Returns the list of columns.
|
int |
getColumnType(java.lang.String columnid)
Returns the column data type.
|
java.lang.String |
getColumnValues(java.lang.String columnid,
int startrow,
int endrow,
java.lang.String delimeter)
Returns concatenated list of column values, with each value separated by a given delimeter
|
java.lang.String |
getColumnValues(java.lang.String columnid,
int startrow,
int endrow,
java.lang.String delimeter,
boolean distinct)
Returns concatenated list of column values, with each value separated by a given delimeter
|
java.lang.String |
getColumnValues(java.lang.String columnid,
java.lang.String delimeter)
Returns concatenated list of column values, with each value separated by a given delimeter
|
java.text.DateFormat |
getDateDisplayFormat(java.lang.String columnid)
Returns current date display format for column.
|
double |
getDouble(int row,
java.lang.String columnid)
Get an int value from a Numeric column.
|
double |
getDouble(int row,
java.lang.String columnid,
double defaultvalue)
Get an int value from a Numeric column with a default value if the value is null.
|
DataSet |
getFilteredDataSet(java.util.HashMap filtermap)
Returns a new DataSet representing a subset of the rows in the current DataSet, as specified by a filtering HashMap.
|
DataSet |
getFilteredDataSet(java.util.HashMap filtermap,
boolean exclusive) |
java.util.ArrayList<DataSet> |
getGroupedDataSets(java.lang.String columnList)
Returns an ArrayList of DataSets that have been grouped by one or more columns.
|
java.lang.String |
getId() |
com.labvantage.sapphire.DataSetIndex |
getIndex()
Get index for this data set.
|
int |
getInt(int row,
java.lang.String columnid)
Get an int value from a Numeric column.
|
int |
getInt(int row,
java.lang.String columnid,
int defaultvalue)
Get an int value from a Numeric column with a default value if the value is null.
|
java.util.Set<java.lang.String> |
getKeyColumnSet()
Get list of key columns of this data set.
|
java.util.Locale |
getLocale()
Return the locale the dataset object uses.
|
long |
getLong(int row,
java.lang.String columnid)
Get an int value from a Numeric column.
|
M18NUtil |
getM18n() |
java.lang.Object |
getObject(int row,
java.lang.String columnid)
Returns an object containing the String, BigDecimal or Calendar for a given row / column.
|
int |
getRowCount()
Returns the number of rows.
|
DataSet |
getRows(int from,
int to) |
java.util.ArrayList<DataSet> |
getSplitDataSets(int maxRows)
Returns an ArrayList of DataSets that have been split from the original into datasets of a maximum size.
|
java.lang.String |
getString(int row,
java.lang.String columnid)
Get a string value from a String column.
|
java.lang.String |
getString(int row,
java.lang.String columnid,
java.lang.String defaultvalue)
Get a string value from a String column with a default value if the string is null (or empty).
|
java.sql.Timestamp |
getTimestamp(int row,
java.lang.String columnid)
Get a JDBC Timestamp object from a Date column.
|
java.sql.Timestamp |
getTimestamp(int row,
java.lang.String columnid,
java.sql.Timestamp defaultvalue)
Get a JDBC Timestamp object from a Date column with a default value if the value is null.
|
java.util.TimeZone |
getTimeZone()
Return the timezone the dataset object uses.
|
java.lang.String |
getValue(int row,
java.lang.String columnid)
Returns a String representing the value for the specified row / column, independant of column type.
|
java.lang.String |
getValue(int row,
java.lang.String columnid,
boolean ignoreMasking)
Returns a String representing the value for the specified row / column, independant of column type.
|
java.lang.String |
getValue(int row,
java.lang.String columnid,
java.lang.String nullvalue)
Returns a String representing the value for the specified row / column, independant of column type.
|
boolean |
isIndexing()
Check if any column is indexed.
|
boolean |
isIndexing(java.lang.String column)
Check if column is indexed.
|
boolean |
isMasked(int row,
java.lang.String columnid)
Checks if the value in the specified row and column is applicable for data masking when being accessed by the getValue method.
|
boolean |
isNull(int row,
java.lang.String columnid)
Checks whether a value is null (or an empty string if the column is a String column).
|
boolean |
isValidColumn(java.lang.String columnid)
Checks whether the columnid has already been added.
|
void |
moveRow(int from,
int amount) |
void |
padColumn(java.lang.String columnid)
Runs down a column and fills in any null values (or empty String values if it is
a String column ) with the non-null value from the previous row.
|
void |
padColumns()
Runs down all columns and fills in any null values (or empty String values if it is
a String column ) with the non-null value from the previous row.
|
void |
removeColumn(java.lang.String oldColumnid) |
void |
renameColumn(java.lang.String oldColumnid,
java.lang.String newColumnid)
Rename a column
|
void |
reset()
Clears all data, sorts and columns from the dataset.
|
void |
setCdataEscape(java.lang.String escape)
set the CDATA escape sequence to be used when calling toXML() on the DataSet
|
boolean |
setClob(int row,
java.lang.String columnid,
java.lang.String value)
Adds a clob into the dataset at the specified point.
|
void |
setColidCaseSensitive(boolean isColidCaseSensitive)
Specify a whether the dataset object should treat columnid as case sensitive.
|
boolean |
setColumnRowString(java.lang.String columns,
java.lang.String rowdata)
Populates the dataset from a string containing column names and a string containing row data.
|
boolean |
setColumnRowString(java.lang.String columns,
java.lang.String rowdata,
java.lang.String delim1,
java.lang.String delim2) |
void |
setConnectionInfo(com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
Specify a connectionInfo object(usually available in the sapphireConnection variable) for formatting date and number type column to string by getValue methods and for setValue methods to interpret inputs of date and number
|
boolean |
setDate(int row,
java.lang.String columnid,
java.util.Calendar value)
Adds a Calendar into the dataset at the specified point.
|
boolean |
setDate(int row,
java.lang.String columnid,
long value)
Adds a date (parsed from a long) into the dataset at the specified point.
|
boolean |
setDate(int row,
java.lang.String columnid,
java.lang.String value)
Adds a date (parsed from a String) into the dataset at the specified point.
|
boolean |
setDate(int row,
java.lang.String columnid,
java.sql.Timestamp value)
Adds a JDBC Timestamp into the dataset at the specified point.
|
void |
setDateDisplayFormat(java.lang.String columnid,
java.text.DateFormat dateformat)
Specify a DateFormat to use for date type column by getValue methods
|
void |
setId(java.lang.String id) |
boolean |
setJSONObject(org.json.JSONObject json) |
void |
setKeyColumns(java.util.Set<java.lang.String> columnIds)
Set key columns of this data set.
|
void |
setKeyColumns(java.lang.String columnIds)
Set key columns of this data set.
|
void |
setLocale(java.util.Locale locale)
Deprecated.
You should not set the locale directly. Use the DataSet( connectionInfo ) constructor or setM18NUtil instead
|
void |
setM18NUtil(M18NUtil m18NUtil)
Specify a M18NUtil object to use for formatting date and number type column to string by getValue methods and for setValue methods to interpret inputs of date and number
|
boolean |
setMaskedString(int row,
java.lang.String columnid,
java.lang.String value)
Sets the Masked value of the requested cell.
|
boolean |
setNumber(int row,
java.lang.String columnid,
java.math.BigDecimal value)
Adds a number (BigDecimal) into the dataset at the specified point.
|
boolean |
setNumber(int row,
java.lang.String columnid,
double value)
Adds a number (long) into the dataset at the specified point.
|
boolean |
setNumber(int row,
java.lang.String columnid,
int value)
Adds a number (int) into the dataset at the specified point.
|
boolean |
setNumber(int row,
java.lang.String columnid,
long value)
Adds a number (long) into the dataset at the specified point.
|
boolean |
setNumber(int row,
java.lang.String columnid,
java.lang.String value)
Adds a number (parsed from a String) into the dataset at the specified point.
|
boolean |
setObject(int row,
java.lang.String columnid,
java.lang.Object o)
Adds an object into the dataset at the specified point.
|
boolean |
setResultSet(java.sql.ResultSet rs)
Populates dataset with JDBC result set.
|
boolean |
setResultSet(java.sql.ResultSet rs,
boolean extendedDataTypes,
java.lang.String dbms)
Populates dataset with JDBC result set.
|
boolean |
setResultSet(java.sql.ResultSet rs,
boolean extendedDataTypes,
java.lang.String dbms,
DataSet.ResultSetRowProcessor rowProcessor)
Populates dataset with JDBC result set.
|
boolean |
setSequence(int startrow,
int endrow,
java.lang.String columnid,
int startseq)
Populates a subset of rows of a numeric column with a sequentially increasing value.
|
boolean |
setSequence(java.lang.String columnid)
Populates a numeric column with a sequentially increasing value.
|
boolean |
setString(int row,
java.lang.String columnid,
java.lang.String value)
Adds a string into the dataset at the specified point.
|
void |
setTimeZone(java.util.TimeZone timezone)
Deprecated.
You should not set the timezone directly. Use the DataSet( connectionInfo ) constructor or setM18NUtil instead
|
void |
setTimeZoneInsensitive(java.lang.String columnid)
Specify a Date Column to use system default time zone for parsing and formatting when setValue and getValue methods are called.
|
boolean |
setValue(int row,
java.lang.String columnid,
java.lang.String value)
Adds a string value into the dataset at the specified point, converted to the appropriate data type.
|
boolean |
setXML(java.lang.String xml)
Populates dataset with JDBC result set.
|
void |
showData()
Writes the contents of the dataset to the System.out stream.
|
void |
sort(java.lang.String sortstring)
Sorts the dataset according to the specified sort criteria.
|
void |
sort(java.lang.String sortstring,
boolean ignoreMaskedData) |
java.lang.String |
toHTML()
Default toHTML() method.
|
java.lang.String |
toHTML(java.util.List titles)
Default toHTML() method.
|
java.lang.String |
toHTML(java.util.List titles,
java.util.List columnIds) |
java.lang.String |
toHTML(java.util.List titles,
java.lang.String stylePrefix)
Default toHTML() method.
|
java.lang.String |
toHTML(java.util.List titles,
java.lang.String stylePrefix,
java.util.List<java.lang.String> columnIds)
Default toHTML() method.
|
org.json.JSONObject |
toJSONObject() |
org.json.JSONObject |
toJSONObject(boolean includeClobs,
boolean includeUnknows) |
org.json.JSONObject |
toJSONObject(boolean optimizedFormat,
boolean includeClobs,
boolean includeUnknows) |
org.json.JSONObject |
toJSONObject(boolean optimizedFormat,
java.lang.String[] columns,
boolean useDataTypes,
boolean includeClobs,
boolean includeUnknows) |
java.lang.String |
toJSONString() |
java.lang.String |
toJSONString(boolean includeClobs,
boolean includeUnknows) |
java.lang.String |
toJSONString(boolean optimizedFormat,
boolean includeClobs,
boolean includeUnknows) |
java.lang.String |
toJSONString(boolean optimizedFormat,
java.lang.String[] columns,
boolean useDataTypes,
boolean includeClobs,
boolean includeUnknows) |
java.lang.String |
toString()
Default toString() method.
|
java.lang.String |
toXML()
Default toXML() method.
|
java.lang.String |
toXML(boolean includeClobs)
Default toXML() method.
|
java.lang.String |
toXML(boolean includeClobs,
boolean includeColumnDefinitions)
Default toXML() method.
|
boolean |
useIndex(java.util.HashMap filter)
Check if filtering data set with given filter would benefit from using indexing.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public static final int SUCCESS
public static final int FAILURE
public static final int UNKNOWN
public static final int STRING
public static final int NUMBER
public static final int DATE
public static final int CLOB
public static final int NULLNUMBER
public DataSet()
public DataSet(com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
connectionInfo
- that will be used to set the locale and timezone of the DateSet instance.public DataSet(java.sql.ResultSet rs)
rs
- JDBC result set that will be used to popuplate the dataset.public DataSet(java.sql.ResultSet rs, com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
rs
- JDBC result set that will be used to popuplate the dataset.connectionInfo
- that will be used to set the locale and timezone of the DateSet instance.public DataSet(java.lang.String xml)
xml
- XML string or rows and columns that will be used to popuplate the dataset.public DataSet(org.json.JSONObject job)
public DataSet(java.lang.String xml, com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
xml
- XML string or rows and columns that will be used to popuplate the dataset.connectionInfo
- that will be used to set the locale and timezone of the DateSet instance.public DataSet(java.lang.String columnnames, java.lang.String rowdata)
columnnames
- String containing columns that will be used to popuplate the dataset (must be semi-colon delimited).rowdata
- String containing data in column1|column2;column1|column2 format (columns must be pipe delimted and rows semi-colon delimited)public DataSet(java.util.Locale locale, java.util.TimeZone timezone)
locale
- that will be used to parse, format the date and number value.timezone
- that will be used to parse and format the date value.public DataSet(java.sql.ResultSet rs, java.util.Locale locale, java.util.TimeZone timezone)
rs
- JDBC result set that will be used to popuplate the dataset.locale
- that will be used to parse, format the date and number value.timezone
- that will be used to parse and format the date value.public DataSet(java.lang.String xml, java.util.Locale locale, java.util.TimeZone timezone)
xml
- XML string or rows and columns that will be used to popuplate the dataset.locale
- that will be used to parse, format the date and number value.timezone
- that will be used to parse and format the date value.public void setId(java.lang.String id)
public java.lang.String getId()
public void setCdataEscape(java.lang.String escape)
public java.lang.String getCdataEscape()
public java.lang.String toXML()
public java.lang.String toXML(boolean includeClobs)
includeClobs
- indicate whether CLOB fields will be included in the final outputpublic org.json.JSONObject toJSONObject()
public org.json.JSONObject toJSONObject(boolean includeClobs, boolean includeUnknows)
public org.json.JSONObject toJSONObject(boolean optimizedFormat, boolean includeClobs, boolean includeUnknows)
public org.json.JSONObject toJSONObject(boolean optimizedFormat, java.lang.String[] columns, boolean useDataTypes, boolean includeClobs, boolean includeUnknows)
public DataSet copy(java.lang.String[] columns, boolean includeClobs)
public DataSet getRows(int from, int to)
public boolean setJSONObject(org.json.JSONObject json)
public java.lang.String toJSONString()
toJSONString
in interface com.labvantage.sapphire.gwt.shared.JSONable
public java.lang.String toJSONString(boolean includeClobs, boolean includeUnknows)
public java.lang.String toJSONString(boolean optimizedFormat, boolean includeClobs, boolean includeUnknows)
public java.lang.String toJSONString(boolean optimizedFormat, java.lang.String[] columns, boolean useDataTypes, boolean includeClobs, boolean includeUnknows)
public java.lang.String toXML(boolean includeClobs, boolean includeColumnDefinitions)
includeClobs
- indicate whether CLOB fields will be included in the final outputincludeColumnDefinitions
- indicate whether column definitions will be includedpublic java.lang.String toHTML(java.util.List titles)
titles
- A list of the titles to display for each column. Pass in a null or empty list to display no titlespublic java.lang.String toHTML()
public java.lang.String toHTML(java.util.List titles, java.util.List columnIds)
public java.lang.String toHTML(java.util.List titles, java.lang.String stylePrefix, java.util.List<java.lang.String> columnIds)
titles
- A list of the titles to display for each column. Pass in a null or empty list to display no titlesstylePrefix
- A prefix for the classnamescolumnIds
- A list of columns which will be rendered only. The columns are rendered according to the order provided in the Listpublic java.lang.String toHTML(java.util.List titles, java.lang.String stylePrefix)
titles
- A list of the titles to display for each column. Pass in a null or empty list to display no titlesstylePrefix
- A prefix for the classnamespublic java.lang.String toString()
toString
in class java.util.AbstractCollection
public void showData()
public void reset()
public void deleteRow(int row)
public void moveRow(int from, int amount)
public boolean setResultSet(java.sql.ResultSet rs)
rs
- JDBC result set that will be used to popuplate the dataset.public boolean setResultSet(java.sql.ResultSet rs, boolean extendedDataTypes, java.lang.String dbms)
rs
- JDBC result set that will be used to popuplate the dataset.extendedDataTypes
- generates a dataset that handles extended data types, including CLOBSdbms
- either MSS or ORApublic boolean setResultSet(java.sql.ResultSet rs, boolean extendedDataTypes, java.lang.String dbms, DataSet.ResultSetRowProcessor rowProcessor)
rs
- JDBC result set that will be used to popuplate the dataset.extendedDataTypes
- generates a dataset that handles extended data types, including CLOBSdbms
- either MSS or ORApublic boolean setXML(java.lang.String xml)
xml
- XML String containing rows and columns that will be used to popuplate the dataset.public boolean setColumnRowString(java.lang.String columns, java.lang.String rowdata)
columns
- String containing columns that will be used to popuplate the dataset (must be semi-colon delimited).rowdata
- String containing data in column1|column2;column1|column2 format (columns must be pipe delimted and rows semi-colon delimited)public boolean setColumnRowString(java.lang.String columns, java.lang.String rowdata, java.lang.String delim1, java.lang.String delim2)
public int addRow()
public int addRow(int newrow)
newrow
- rownumber at which the new row is to be insertedpublic void copyRow(int copyrow, int copies)
copyrow
- the row number to copy.copies
- the number of copies you want to generate.public void copyRow(DataSet from, int copyrow, int copies)
from
- the dataset containing the row to copy.copyrow
- the row number to copy. Use -1 to copy all rowscopies
- the number of copies you want to generate.public int getRowCount()
public boolean addColumn(java.lang.String columnid, int type)
columnid
- the name of the column.type
- indicate the data type. Use either DataSet.STRING, DataSet.NUMBER or DataSet.DATE.public boolean addColumn(java.lang.String columnid, int type, int length)
columnid
- the name of the column.type
- indicate the data type. Use either DataSet.STRING, DataSet.NUMBER or DataSet.DATE.length
- indicate the length for string typepublic boolean addColumnValues(java.lang.String columnid, int type, java.lang.String valueslist, java.lang.String delimeter, java.lang.String defaultvalue)
columnid
- the name of the column.type
- the datatype of the column. Use either DataSet.STRING, DataSet.NUMBER or DataSet.DATE.valueslist
- delimited list of values to add as rows.delimeter
- used to separate the list of values.defaultvalue
- if the valueslist is null or is an empty stringpublic boolean addColumnValues(java.lang.String columnid, int type, java.lang.String valueslist, java.lang.String delimeter)
columnid
- the name of the column.type
- the datatype of the column. Use either DataSet.STRING, DataSet.NUMBER or DataSet.DATE.valueslist
- delimited list of values to add as rows.delimeter
- used to separate the list of values.public void padColumns()
public void padColumn(java.lang.String columnid)
columnid
- the name of the column to padpublic boolean isValidColumn(java.lang.String columnid)
columnid
- the name of the column to check.public int getColumnCount()
public java.lang.String[] getColumns()
public int getColumnType(java.lang.String columnid)
columnid
- the name of the columns.public int getColumnLength(java.lang.String columnid)
columnid
- the name of the columns.public java.lang.String getColumnId(int col)
col
- the column number.public java.lang.String getColumnValues(java.lang.String columnid, int startrow, int endrow, java.lang.String delimeter)
columnid
- the column namestartrow
- the rows to start from. The value in this row will be included in the final stringendrow
- loop up the this row number. The value in this row will NOT be included in the final stringdelimeter
- the delimeter that will be used to separate the valuepublic java.lang.String getColumnValues(java.lang.String columnid, int startrow, int endrow, java.lang.String delimeter, boolean distinct)
columnid
- the column namestartrow
- the rows to start from. The value in this row will be included in the final stringendrow
- loop up the this row number. The value in this row will NOT be included in the final stringdelimeter
- the delimeter that will be used to separate the valuedistinct
- set to true to only bring distinct valuespublic java.lang.String getColumnValues(java.lang.String columnid, java.lang.String delimeter)
columnid
- the column namedelimeter
- the delimeter that will be used to separate the valuepublic boolean setObject(int row, java.lang.String columnid, java.lang.Object o)
row
- the row to set the value. Specify -1 to set the object into all rows.columnid
- the column id.o
- the object.public boolean setString(int row, java.lang.String columnid, java.lang.String value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the string value.public boolean setClob(int row, java.lang.String columnid, java.lang.String value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the clob value.public boolean setNumber(int row, java.lang.String columnid, int value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the int value. (This will be interally stored as a BigDecimal).public boolean setNumber(int row, java.lang.String columnid, long value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the int value. (This will be interally stored as a BigDecimal).public boolean setNumber(int row, java.lang.String columnid, double value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the double value. (This will be interally stored as a BigDecimal).public boolean setNumber(int row, java.lang.String columnid, java.math.BigDecimal value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the BigDecimal value.public boolean setNumber(int row, java.lang.String columnid, java.lang.String value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the String containing the number. (This will be parsed into and stored as a BigDecimal).public boolean setDate(int row, java.lang.String columnid, long value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the long containing the date as EPOCH millisecond UTC date.public boolean setDate(int row, java.lang.String columnid, java.lang.String value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the String containing the date. (This will be parsed into and stored as a Calendar). If a long number then will be parsed as EPOCH millisecond UTC date.public boolean setDate(int row, java.lang.String columnid, java.util.Calendar value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the Calendar containing the date.public boolean setDate(int row, java.lang.String columnid, java.sql.Timestamp value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id. The column is added if it does not already exist.value
- the Timestamp containing the date. (This will be internally stored as a Calendar).public void setDateDisplayFormat(java.lang.String columnid, java.text.DateFormat dateformat)
columnid
- the date type columnid.dateformat
- the DateFormat object.public java.text.DateFormat getDateDisplayFormat(java.lang.String columnid)
columnid
- the date type columnidpublic void setTimeZoneInsensitive(java.lang.String columnid)
columnid
- the date type columnid.public void setLocale(java.util.Locale locale)
locale
- the locale.public java.util.Locale getLocale()
public void setTimeZone(java.util.TimeZone timezone)
timezone
- the timezone.public java.util.TimeZone getTimeZone()
public void setM18NUtil(M18NUtil m18NUtil)
m18NUtil
- M18N object.public M18NUtil getM18n()
public void setConnectionInfo(com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
connectionInfo
- SapphireConnection object.public DataSet copy()
public void setColidCaseSensitive(boolean isColidCaseSensitive)
isColidCaseSensitive
- the isColidCaseSensitive.public boolean getColidCaseSensitive()
public boolean setValue(int row, java.lang.String columnid, java.lang.String value)
row
- the row to set the value. Specify -1 to set the value into all rows.columnid
- the column id.value
- the String that will be stored or parsed into a BigDecimal or Calendar, depending on the column type.public boolean setSequence(int startrow, int endrow, java.lang.String columnid, int startseq)
startrow
- the dataset row to start the sequence.endrow
- the dataset row to end the sequence.columnid
- the column id that holds the sequence. The column is added as a Numeric column if it does not already exist.startseq
- the value to start the sequence from.public boolean setSequence(java.lang.String columnid)
columnid
- the column id that holds the sequence. The column is added as a Numeric column if it does not already exist.public java.lang.String getString(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a String or Clob column).public java.lang.String getString(int row, java.lang.String columnid, java.lang.String defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a String or Clob column).defaultvalue
- the value to return if the String is null or an empty string.public java.lang.String getClob(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Clob column).public java.lang.String getClob(int row, java.lang.String columnid, java.lang.String defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Clob column).defaultvalue
- the value to return if the String is null or an empty string.public java.math.BigDecimal getBigDecimal(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).public java.math.BigDecimal getBigDecimal(int row, java.lang.String columnid, java.math.BigDecimal defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).defaultvalue
- the value to return if the BigDecimal is null.public double getDouble(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).public double getDouble(int row, java.lang.String columnid, double defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).defaultvalue
- the value to return if the lookup value is null.public int getInt(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).public long getLong(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).public int getInt(int row, java.lang.String columnid, int defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Numeric column).defaultvalue
- the value to return if the lookup value is null.public java.util.Calendar getCalendar(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Date column).public java.util.Calendar getCalendar(int row, java.lang.String columnid, java.util.Calendar defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Date column).defaultvalue
- the value to return if the lookup value is null.public java.sql.Timestamp getTimestamp(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Date column).public java.sql.Timestamp getTimestamp(int row, java.lang.String columnid, java.sql.Timestamp defaultvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this must be a Date column).defaultvalue
- the value to return if the lookup value is null.public java.lang.Object getObject(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the columnid containing the required value.public java.lang.String getValue(int row, java.lang.String columnid)
row
- the row containing the required value.columnid
- the column containing the required value (this can be either a String, Number or Date column).public java.lang.String getValue(int row, java.lang.String columnid, boolean ignoreMasking)
row
- the row containing the required value.columnid
- the column containing the required value (this can be either a String, Number or Date column).ignoreMasking
- If the masked value is to be returned or not for a field which is marked as Masked.public java.lang.String getValue(int row, java.lang.String columnid, java.lang.String nullvalue)
row
- the row containing the required value.columnid
- the column containing the required value (this can be either a String, Number or Date column).nullvalue
- the value returned if the value is null or if it is an empty string from a String column.public boolean isNull(int row, java.lang.String columnid)
row
- the row containing the value to check.columnid
- the column containing the value to check.public void sort(java.lang.String sortstring)
sortstring
- the sort criteria. Specify a comma separated list of columns to sort by.
Optionally specifiy an A or D to determine whether to sort Ascending or Decending.
For example, "col1, col2 D, col3" is a valid sort string.public void sort(java.lang.String sortstring, boolean ignoreMaskedData)
public DataSet getFilteredDataSet(java.util.HashMap filtermap)
filtermap
- java.util.HashMap containing the filter criteria. To use this method, create an empty HashMap,
use the .put method to add values into the map representing the column and value pair to look for.
For example, passing a HashMap that has been populated with filtermap.put( "col1", "XXX" ) will return a
DataSet containing only those rows for which the "col1" column contain the value XXX.public DataSet getFilteredDataSet(java.util.HashMap filtermap, boolean exclusive)
public java.util.ArrayList<DataSet> getSplitDataSets(int maxRows)
maxRows
- The maximum size of any returned datasetpublic java.util.ArrayList<DataSet> getGroupedDataSets(java.lang.String columnList)
columnList
- Comma separated list of columns to group bypublic int findRow(java.util.HashMap findmap, int start)
findmap
- java.util.HashMap containing the find criteria. To use this method, create an empty HashMap,
use the .put method to add values into the map representing the column and value pair to look for.
For example, passing a HashMap that has been populated with filtermap.put( "col1", "XXX" ) will return a
the first row found for which the "col1" column contain the value XXX.
When finding numbers and dates, it is recommended to use an alternative find syntax since the Map find requires BigDecimal and Calendar objectsstart
- the row from which to start looking.public int findRow(java.util.HashMap findmap)
findmap
- java.util.HashMap containing the find criteria. To use this method, create an empty HashMap,
use the .put method to add values into the map representing the column and value pair to look for.
For example, passing a HashMap that has been populated with filtermap.put( "col1", "XXX" ) will return a
the first row found for which the "col1" column contain the value XXX.
When finding numbers and dates, it is recommended to use an alternative find syntax since the Map find requires BigDecimal and Calendar objectspublic int findRow(java.lang.String find)
find
- comma separated list of find criteria. e.g. "col1=XXX,col2=99,col3=YYY"public int findRow(java.lang.String columnId, java.lang.String value)
columnId:
- Column namevalue:
- Column valuepublic void renameColumn(java.lang.String oldColumnid, java.lang.String newColumnid)
oldColumnid
- the name of the old columnnewColumnid
- the name of the new columnpublic void removeColumn(java.lang.String oldColumnid)
public com.labvantage.sapphire.DataSetIndex getIndex()
null
public boolean isIndexing()
public boolean isIndexing(java.lang.String column)
column
- Column to check, null
not permittedpublic boolean useIndex(java.util.HashMap filter)
filter
- Filter to check, null
not permittedpublic void setKeyColumns(java.lang.String columnIds)
columnIds
- Column ids in semicolon separated list, null
not permittedpublic void setKeyColumns(java.util.Set<java.lang.String> columnIds)
columnIds
- Column id set, null
not permittedpublic java.util.Set<java.lang.String> getKeyColumnSet()
null
public boolean isMasked(int row, java.lang.String columnid)
row
- the row containing the value to check.columnid
- the column containing the value to check.public boolean setMaskedString(int row, java.lang.String columnid, java.lang.String value)
row
- columnid
- value
-