public class DataSet extends Object implements Serializable, DataSetProvider, NotComparable
DataSet
is an in memory table of data representing a database
result set. It is usually generated by executing a statement that queries the
database or loading from the external source such as comma delimited or xml
file.Modifier and Type | Field and Description |
---|---|
static String |
ASC_SORT
The ASC sort type.
|
static String |
BASE_FILE_NAME_TO_READ
The Constant BASE_FILE_NAME_TO_READ.
|
static String |
BASE_FILE_NAME_TO_WRITE
The Constant BASE_FILE_NAME_TO_WRITE.
|
static String |
COL
The COL attribute.
|
static String |
DATA
The DATA attribute.
|
static String |
DATA_SET
The DATA_SET attribute.
|
static String |
DATA_SET_DATE_ONLY_FORMAT
Internal date format.
|
static String |
DATA_SET_DATE_TIME_FORMAT
Internal datetime format.
|
static String |
DATA_SET_TIME_FORMAT
Internal time format.
|
static String |
DESC_SORT
The DESC sort type.
|
static String |
DO_NOT_SORT
The DO_NOT SORT type.
|
static String |
ENCODE_ATTR
The ENCODE_ATTR attribute.
|
static String |
FIELD_DEBEZIUM_CDC_OP
The Constant FIELD_DEBEZIUM_CDC_OP.
|
static String |
FIELD_DEBEZIUM_CDC_TIMESTAMP
The Constant FIELD_DEBEZIUM_CDC_TIMESTAMP.
|
static Set<String> |
FIELDS_TO_EXCLUDE_FROM_METADATA_UPDATE
The fields to exclude from metadata update.
|
static String |
FILE_NAME_TO_READ
The Constant FILE_NAME_TO_READ.
|
static String |
FILE_NAME_TO_WRITE
The Constant FILE_NAME_TO_WRITE.
|
static String |
FULL_FILE_NAME_TO_READ
The Constant FULL_FILE_NAME_TO_READ.
|
static String |
FULL_FILE_NAME_TO_WRITE
The Constant FULL_FILE_NAME_TO_WRITE.
|
static String |
KEY_ATTR
The KEY_ATTR attribute.
|
static String |
META_DATA
The META_DATA attribute.
|
static String |
NAME
The NAME attribute.
|
static String |
NATIVE_TYPE_ATTR
The NATIVE_TYPE_ATTR attribute.
|
static String |
NULLABLE_ATTR
The NULLABLE_ATTR attribute.
|
static String |
OBJECT_NAME_TO_READ
The Constant OBJECT_NAME_TO_READ.
|
static String |
ROW
The ROW attribute.
|
static String |
SCALE_ATTR
The SCALE_ATTR attribute.
|
static String |
SIZE_ATTR
The SIZE_ATTR attribute.
|
static String |
TYPE_ATTR
The TYPE_ATTR attribute.
|
static String |
TYPE_NAME
The TYPE_NAME attribute.
|
static String |
VALUE
The VALUE attribute.
|
Constructor and Description |
---|
DataSet()
Instantiates a new data set.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataSetChangeListener(DataSetChangeListener dataSetChangeListener)
Add the data set change listener.
|
void |
addField(FieldDef fieldDef)
Adds the field.
|
void |
addField(FieldDef fieldDef,
int index)
Adds the field at the index.
|
TypedKeyValue<FieldDef,DataSet> |
addField(String fieldName,
int fieldType,
String nativeType,
Object value,
String... separator)
Add the field and the value to the data set.
|
TypedKeyValue<FieldDef,DataSet> |
addField(String fieldName,
Object value,
String... separator)
Add the field and the value to the data set.
|
TypedKeyValue<FieldDef,DataSet> |
addFieldWithType(String fieldName,
int fieldType,
String nativeType,
Object value)
Add the field and the value to the data set.
|
DataSetRecord |
addRecord()
Add the record to the data set.
|
boolean |
addRecord(DataSetRecord record)
Adds the record.
|
boolean |
addRecord(DataSetRecord record,
int row)
Adds the record at the row.
|
void |
addUniqueField(FieldDef fieldDef,
int column)
Adds the field.
|
void |
clear()
Removes all fields and data.
|
void |
clearData()
Clears data.
|
void |
clearNextRow()
Clears the "next row" set.
|
DataSet |
copy()
Copy this data set.
|
DataSet |
copyEssentials()
Copy essential fields.
|
void |
copyPropertiesFrom(DataSet dataSet)
Copy properties from.
|
Object |
decode(FieldDef fieldDef,
String fieldValue,
Driver driver,
Map<String,String> params)
Decodes value of the field using Base64 algorithm.
|
Object |
decode(FieldDef fieldDef,
String fieldValue,
Driver driver,
Map<String,String> params,
boolean decode)
Decodes value of the field using Base64 algorithm.
|
DataSetRecord |
deleteRecord(int row)
Deletes record at the row.
|
String |
encode(FieldDef fieldDef,
Object fieldValue,
Driver driver,
Map<String,String> params,
boolean encode,
boolean booleanToNumber)
Encodes value of the field using Base64 algorithm.
|
String |
encode(Object value,
int fType)
Encodes value of the field using Base64 algorithm.
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
boolean |
filter(DataSetRecord record)
Filters record using expression.
|
TypedKeyValue<FieldDef,DataSet> |
findField(String fieldName,
String... separator)
Find field.
|
void |
fireDataSetChangeListeners(DataSetRecord record)
Fire data set change listeners.
|
void |
forEach(DataSetVisitor callback,
boolean depthFirst)
Recursively traverse dataset and all nested datasets.
|
Object |
getActualData()
Gets the additional data associated with data set.
|
long |
getAddedRecords()
Gets the added records.
|
String |
getAdditionalInfo()
Gets the additional info such as transformation type.
|
Connection |
getConnection()
Gets the connection.
|
DataSetRecord |
getCurrentRecord()
Gets the current record.
|
DataSetRecord |
getCursorRecord(Driver driver)
Gets the current record as a "cursor" using given driver.
|
DataSetData |
getData()
Gets the data.
|
String |
getDataObjectToRead()
Gets the name of the data object to read.
|
DataSet |
getDataSet()
Gets the data set.
|
List<DataSetChangeListener> |
getDataSetChangeListeners()
Gets the list of data set change listeners.
|
Map<String,DataSetRecord> |
getDataSetIndex()
Gets the index.
|
Object |
getDisplayFieldValue(Object value,
FieldDef field,
int rowIndex)
Gets the display value of the field for the field.
|
Object |
getDisplayFieldValue(Object value,
int index,
int rowIndex)
Gets the display value of the field from the record by the index of the
field.
|
Object |
getDisplayFieldValue(Object value,
String name,
int rowIndex)
Gets the display value of the field from the record by the name of the
field.
|
Map<String,TypedKeyValue<String,String>> |
getDisplayFunctions()
Gets the display functions.
|
String |
getDisplayKeyField()
Gets the "display name" of the key field.
|
Driver |
getDriver()
Gets the driver.
|
DataSetRecord |
getEmptyRecord()
Gets the empty record.
|
String |
getFieldAttr(FieldDef fieldDef,
String name)
Gets the field's attribute by given name.
|
int |
getFieldCount()
Gets the number of fields.
|
FieldDef |
getFieldDef(int pos)
Gets the field by index.
|
FieldDef |
getFieldDef(String name)
Gets the field by name.
|
int |
getFieldIndex(FieldDef field)
Gets the field index.
|
int |
getFieldIndex(String name)
Gets the index of the field by name of the field.
|
DataSetFields |
getFields()
Gets the fields.
|
Object |
getFieldValue(DataSetRecord record,
FieldDef field)
Gets the value of the field from the record by the field.
|
Object |
getFieldValue(DataSetRecord record,
int index)
Gets the value of the field from the record by the index of the field.
|
Object |
getFieldValue(DataSetRecord record,
String name)
Gets the value of the field from the record by the name of the field.
|
Object |
getFieldValue(DataSetRecord record,
String fieldName,
String separator,
Integer... row)
Gets the field value from the nested dataset.
|
Object |
getFieldValue(int row,
int col)
Gets the value of the field from the record
row by the index
of the col . |
Object |
getFieldValue(int theRow,
String fieldName,
String separator,
Integer... row)
Gets the field value from the nested dataset.
|
TypedKeyValue<FieldDef,Object> |
getFieldValueWithNested(DataSetRecord record,
String fieldName)
Gets the field value from the nested dataset.
|
TypedKeyValue<FieldDef,Object> |
getFieldValueWithNested(int row,
String fieldName)
Gets the field value from the nested dataset.
|
String |
getFileName(String dataLocation,
String ext)
Gets the data set file name using given folder and extension.
|
String |
getFileNameToRead()
Gets the file name to read.
|
String |
getFileNameToWrite()
Gets the file name to write.
|
String |
getKeyFields()
Gets the names of the key fields.
|
String |
getName()
Gets the name.
|
TreeMap<String,FieldDef> |
getNonCaseSensitiveFields()
Gets the non case sensitive fields.
|
Object |
getNullableFieldValue(DataSetRecord record,
FieldDef field)
Gets the value of the field from the record by the field.
|
Object |
getNullableFieldValue(DataSetRecord record,
int index)
Gets the value of the field from the record by the index of the
field.Returns empty data set if the field value is null
|
Object |
getNullableFieldValue(DataSetRecord record,
String name)
Gets the value of the field from the record by the name of the field.
|
Object |
getNullableFieldValue(DataSetRecord record,
String fieldName,
String separator,
Integer... row)
Gets the field value from the nested dataset.
|
Object |
getNullableFieldValue(int row,
int col)
Gets the value of the field from the record
row by the index
of the col . |
Object |
getNullableFieldValue(int theRow,
String fieldName,
String separator,
Integer... row)
Gets the field value from the nested dataset.
|
Object |
getNullableFieldValue(Object value)
Gets the nullable field value.
|
TypedKeyValue<FieldDef,Object> |
getNullableFieldValueWithNested(DataSetRecord record,
String fieldName)
Gets the field value from the nested dataset.
|
TypedKeyValue<FieldDef,Object> |
getNullableFieldValueWithNested(int row,
String fieldName)
Gets the field value from the nested dataset.
|
String |
getObjectName()
Gets the object name which is either data set name or table name.
|
String |
getOwnerName()
Gets the owner name.
|
DataSet |
getParentDataSet()
Gets the parent data set.
|
DataSetRecord |
getParentDataSetRecord()
Gets the parent data set record.
|
Object |
getParentFieldValue(DataSetRecord record,
String name)
Gets the parent field value.
|
DataSetRecord |
getRecord(int row)
Gets the record using given index of the record.
|
DataSetRecord |
getRecord(String key)
Get record by key.
|
int |
getRecordCount()
Gets the number of records.
|
DataSetRowSorter |
getRowSorter()
Gets the row sorter.
|
List<FieldDef> |
getSortedFields()
Gets the sorted by index fields.
|
Driver |
getSourceDriver()
Gets the source driver.
|
String |
getSourceTableName()
Gets the source table name.
|
String |
getTableName()
Gets the table name.
|
String |
getUuid()
Gets the uuid.
|
Map<String,Variable> |
getVariables()
Gets the variables.
|
int |
getVisibleFieldCount()
Gets the visible field count.
|
boolean |
hasLargeObjects()
Checks if data set has CLOBs or BLOBs.
|
void |
init()
Initialize the data set.
|
boolean |
isEmpty()
Checks if data set is empty.
|
boolean |
isEncode()
Checks if encoded flag set for the data set.
|
boolean |
isFieldEncoded(FieldDef fieldDef)
Checks if field is encoded.
|
boolean |
isInnerDataSet()
Checks if it is inner data set.
|
boolean |
isNestedField(String fieldName,
String... separator)
Checks field represented by given name is a nested field.
|
boolean |
isUpdateIndexOnChange()
Checks if index should be updated automatically.
|
boolean |
isValidationFailed()
Checks if is validation failed.
|
void |
nextRow()
Sets the "next row" state.
|
LinkedHashMap<String,Boolean> |
parseOrderByString(String orderBy)
Parses the order by string.
|
void |
removeDataSetChangeListener(DataSetChangeListener dataSetChangeListener)
Removes the data set change listener.
|
void |
removeField(FieldDef fieldDef)
Removes the field.
|
void |
setActualData(Object actualData)
Sets the additional data associated with data set.
|
void |
setAdditionalInfo(String value)
Sets the additional info, such as transformation type.
|
void |
setConnection(Connection value)
Sets the connection.
|
void |
setCurrentRecord(DataSetRecord currentRecord)
Sets the current record.
|
void |
setData(DataSetData value)
Sets the data.
|
void |
setDataObjectToRead(String objectToRead)
Sets the name of the data object to read.
|
void |
setDataSetIndex(Map<String,DataSetRecord> value)
Sets the index..
|
void |
setDisplayFunctions(Map<String,TypedKeyValue<String,String>> functions)
Sets the display functions.
|
void |
setDisplayKeyField(String value)
Sets the "display name" for the key field.
|
void |
setDriver(Driver value)
Sets the driver.
|
void |
setEncode(boolean value)
Sets the encoded flag for the data set.
|
void |
setField(FieldDef fieldDef)
Replaces current field defined by field.getName() on the given field.
|
void |
setFieldAttr(FieldDef fieldDef,
String name,
String value)
Sets the attribute of the field.
|
void |
setFields(DataSetFields value)
Sets the fields.
|
void |
setFieldValue(DataSetRecord record,
int index,
Object value)
Sets the field value.
|
void |
setFieldValue(DataSetRecord record,
String name,
Object value)
Sets the field value.
|
void |
setFieldValue(int row,
int col,
Object value)
Sets the field value.
|
void |
setFieldValue(int row,
String name,
Object value)
Sets the field value.
|
void |
setFileNameToRead(String fileNameToRead)
Sets the file name to read.
|
void |
setFileNameToWrite(String fileNameToWrite)
Sets the file name to write.
|
void |
setFilter(String filter)
Sets the filter.
|
void |
setInnerDataSet(boolean innerDataSet,
DataSet parent)
Sets the inner data set flag.
|
void |
setKeyFields(String value)
Sets the names of the key fields.
|
void |
setName(String value)
Sets the name.
|
void |
setOwnerName(String value)
Sets the owner name.
|
void |
setParentDataSet(DataSet parentDataSet)
Sets the parent data set.
|
void |
setParentDataSetRecord(DataSetRecord parentDataSetRecord)
Sets the parent data set record.
|
void |
setRecord(DataSetRecord record,
int row)
Sets the record.
|
void |
setRowSorter(DataSetRowSorter rowSorter)
Sets the data set row sorter.
|
void |
setSourceDriver(Driver value)
Sets the source driver.
|
void |
setSourceTableName(String value)
Sets the source table name.
|
void |
setSupportsSorting(boolean value)
Sets the supports sorting flag.
|
void |
setTableName(String value)
Sets the table name.
|
void |
setUpdateIndexOnChange(boolean value)
Sets the value for the "update index on change event" flag.
|
void |
setValidationFailed(boolean validationFailed)
Sets the validation failed.
|
void |
setValue(DataSetRecord record,
String name,
Object value,
int... type)
Sets the field value.
|
DataSetRecord |
setValue(Object value,
int index)
Sets the "column" value using the following algorithms: If value is
within boundaries of the current record it assumes that new record must
be added to the data set.
|
void |
setVariables(Map<String,Variable> value)
Sets the variables.
|
void |
sortByFieldIndex(List<TypedKeyValue<Integer,DataSetData.SortType>> orderBy)
Sorts data using given order by list with field indexes.
|
void |
sortByFieldName(List<TypedKeyValue<String,DataSetData.SortType>> orderBy)
Sorts data using given order by list with field names.
|
void |
sortByString(String orderBy)
Sorts data using given "order by" string.
|
boolean |
structureEquals(DataSet dataSet)
Checks if two datasets are structure equal.
|
boolean |
supportsSorting()
Checks if data set supports sorting.
|
void |
updateFieldsWithSpaces()
Update fields with spaces.
|
TypedKeyValue<List<String>,List<String>> |
updateFromMetadata(LinkedHashMap<String,FieldDef> metadata,
boolean source,
boolean dest,
boolean create,
boolean alter,
boolean orderAndType,
boolean typeOnly,
ListHashMap<String,Variable> variables)
Update fields from metadata.
|
void |
updateIndexOnAdd(DataSetRecord currentRow)
Updates index on "add record" event.
|
void |
updateIndexOnDelete(DataSetRecord currentRow)
Updates index on "delete record" event.
|
public static final String FIELD_DEBEZIUM_CDC_OP
public static final String FIELD_DEBEZIUM_CDC_TIMESTAMP
public static Set<String> FIELDS_TO_EXCLUDE_FROM_METADATA_UPDATE
public static final String DO_NOT_SORT
public static final String ASC_SORT
public static final String DESC_SORT
public static final String DATA_SET
public static final String NAME
public static final String META_DATA
public static final String DATA
public static final String ROW
public static final String COL
public static final String VALUE
public static final String TYPE_NAME
public static final String TYPE_ATTR
public static final String SIZE_ATTR
public static final String SCALE_ATTR
public static final String NATIVE_TYPE_ATTR
public static final String NULLABLE_ATTR
public static final String ENCODE_ATTR
public static final String KEY_ATTR
public static final String DATA_SET_DATE_TIME_FORMAT
public static final String DATA_SET_DATE_ONLY_FORMAT
public static final String DATA_SET_TIME_FORMAT
public static final String FULL_FILE_NAME_TO_READ
public static final String BASE_FILE_NAME_TO_READ
public static final String FILE_NAME_TO_READ
public static final String OBJECT_NAME_TO_READ
public static final String FULL_FILE_NAME_TO_WRITE
public static final String BASE_FILE_NAME_TO_WRITE
public static final String FILE_NAME_TO_WRITE
public void nextRow()
public void clearNextRow()
public void addDataSetChangeListener(DataSetChangeListener dataSetChangeListener)
dataSetChangeListener
- the dataSetChangeListener to addpublic void addUniqueField(FieldDef fieldDef, int column)
fieldDef
- the fieldcolumn
- the columnpublic void addField(FieldDef fieldDef)
fieldDef
- the fieldpublic void addField(FieldDef fieldDef, int index)
fieldDef
- the fieldindex
- the indexpublic boolean addRecord(DataSetRecord record)
record
- the recordpublic boolean addRecord(DataSetRecord record, int row)
record
- the recordrow
- the rowpublic DataSetRecord addRecord()
public TypedKeyValue<FieldDef,DataSet> addField(String fieldName, Object value, String... separator)
fieldName
- the field namevalue
- the valueseparator
- the separator. Default is "."public TypedKeyValue<FieldDef,DataSet> addFieldWithType(String fieldName, int fieldType, String nativeType, Object value)
fieldName
- the field namefieldType
- the field typenativeType
- the native SQL typevalue
- the valuepublic TypedKeyValue<FieldDef,DataSet> addField(String fieldName, int fieldType, String nativeType, Object value, String... separator)
fieldName
- the field namefieldType
- the field typenativeType
- the native SQL typevalue
- the valueseparator
- the separator. Default is "."public DataSetRecord setValue(Object value, int index)
value
- the valueindex
- the indexpublic boolean isNestedField(String fieldName, String... separator)
fieldName
- the field nameseparator
- the separatorpublic TypedKeyValue<FieldDef,DataSet> findField(String fieldName, String... separator)
fieldName
- the field nameseparator
- the separatorpublic void forEach(DataSetVisitor callback, boolean depthFirst)
callback
- DataSetVisitordepthFirst
- boolean, if true this function will iterate through the inner
data sets firstpublic void clear()
public void clearData()
public void init()
public DataSet copy()
public DataSet copyEssentials()
public void copyPropertiesFrom(DataSet dataSet)
dataSet
- the data setpublic Object decode(FieldDef fieldDef, String fieldValue, Driver driver, Map<String,String> params) throws Exception
true. If field is not CLOB, BLOB or encoded flavor of CHAR
returns given fieldValue.
fieldDef
- the fieldfieldValue
- the field valuedriver
- the driverparams
- the parametersException
- in case of any errorpublic Object decode(FieldDef fieldDef, String fieldValue, Driver driver, Map<String,String> params, boolean decode) throws Exception
true. If field is not CLOB, BLOB or encoded flavor of CHAR
returns given fieldValue.
fieldDef
- the fieldfieldValue
- the field valuedriver
- the driverparams
- the parametersdecode
- the decode. If false does not perform decodingException
- in case of any errorpublic DataSetRecord deleteRecord(int row)
row
- the rowpublic String encode(FieldDef fieldDef, Object fieldValue, Driver driver, Map<String,String> params, boolean encode, boolean booleanToNumber)
true.
fieldDef
- the fieldfieldValue
- the field valuedriver
- the driverparams
- the parametersencode
- the encode. If false does not perform encodingbooleanToNumber
- if true convert boolean true/false to 1/0public String encode(Object value, int fType)
value
- The field valuefType
- The field type. Belongs to java.sql.Types
public boolean equals(Object o)
equals
in class Object
o
- The object to compare withpublic boolean filter(DataSetRecord record)
record
- the recordpublic void fireDataSetChangeListeners(DataSetRecord record)
record
- the recordpublic String getAdditionalInfo()
public Connection getConnection()
public DataSetRecord getCursorRecord(Driver driver)
driver
- the driverpublic DataSetData getData()
public DataSet getDataSet()
DataSetProvider
getDataSet
in interface DataSetProvider
public List<DataSetChangeListener> getDataSetChangeListeners()
public Map<String,DataSetRecord> getDataSetIndex()
public Object getDisplayFieldValue(Object value, FieldDef field, int rowIndex)
value
- the valuefield
- the fieldrowIndex
- the row indexpublic Object getDisplayFieldValue(Object value, int index, int rowIndex)
value
- the valueindex
- the index of the fieldrowIndex
- the row indexpublic Object getDisplayFieldValue(Object value, String name, int rowIndex)
value
- the valuename
- the namerowIndex
- the row indexpublic Map<String,TypedKeyValue<String,String>> getDisplayFunctions()
public String getDisplayKeyField()
public Driver getDriver()
public DataSetRecord getEmptyRecord()
public String getFieldAttr(FieldDef fieldDef, String name)
fieldDef
- the fieldname
- the name of the attributepublic int getFieldCount()
public FieldDef getFieldDef(int pos)
pos
- The index of the fieldpublic FieldDef getFieldDef(String name)
name
- The name of the fieldpublic int getFieldIndex(FieldDef field)
field
- the fieldpublic int getFieldIndex(String name)
name
- the name of the fieldpublic DataSetFields getFields()
public Object getFieldValue(DataSetRecord record, FieldDef field)
record
- The recordfield
- the fieldpublic Object getParentFieldValue(DataSetRecord record, String name)
record
- the actual record. The record must have a parent recordname
- the field namepublic Object getNullableFieldValue(Object value)
value
- the valuepublic Object getNullableFieldValue(DataSetRecord record, FieldDef field)
record
- The recordfield
- the fieldpublic Object getFieldValue(DataSetRecord record, int index)
record
- The recordindex
- The index of the fieldpublic Object getNullableFieldValue(DataSetRecord record, int index)
record
- The recordindex
- The index of the fieldpublic Object getFieldValue(DataSetRecord record, String name)
record
- The recordname
- The name of the fieldpublic Object getNullableFieldValue(DataSetRecord record, String name)
record
- The recordname
- The name of the fieldpublic Object getFieldValue(int row, int col)
row
by the index
of the col
.row
- the rowcol
- the columnpublic Object getNullableFieldValue(int row, int col)
row
by the index
of the col
. Returns empty data set if the field value is
nullrow
- the rowcol
- the columnpublic TypedKeyValue<FieldDef,Object> getFieldValueWithNested(DataSetRecord record, String fieldName)
record
- the recordfieldName
- the field namepublic TypedKeyValue<FieldDef,Object> getFieldValueWithNested(int row, String fieldName)
row
- the rowfieldName
- the field namepublic TypedKeyValue<FieldDef,Object> getNullableFieldValueWithNested(int row, String fieldName)
row
- the rowfieldName
- the field namepublic TypedKeyValue<FieldDef,Object> getNullableFieldValueWithNested(DataSetRecord record, String fieldName)
record
- the recordfieldName
- the field namepublic Object getFieldValue(DataSetRecord record, String fieldName, String separator, Integer... row)
record
- the recordfieldName
- the field nameseparator
- the separatorrow
- the rowpublic Object getFieldValue(int theRow, String fieldName, String separator, Integer... row)
theRow
- the the rowfieldName
- the field nameseparator
- the separatorrow
- the rowpublic Object getNullableFieldValue(DataSetRecord record, String fieldName, String separator, Integer... row)
record
- the recordfieldName
- the field nameseparator
- the separatorrow
- the rowpublic Object getNullableFieldValue(int theRow, String fieldName, String separator, Integer... row)
theRow
- the the rowfieldName
- the field nameseparator
- the separatorrow
- the rowpublic String getFileName(String dataLocation, String ext)
dataLocation
- The path to the fileext
- The extensionpublic String getKeyFields()
public String getName()
public TreeMap<String,FieldDef> getNonCaseSensitiveFields()
public String getObjectName()
Utils.isNothing(getTableName()) ? getName() : getTableName();
public String getOwnerName()
public DataSetRecord getRecord(int row)
row
- The index of the recordpublic DataSetRecord getRecord(String key)
key
- the keypublic int getRecordCount()
public DataSetRowSorter getRowSorter()
public Driver getSourceDriver()
public String getSourceTableName()
public String getTableName()
public Map<String,Variable> getVariables()
public int getVisibleFieldCount()
public boolean hasLargeObjects()
public boolean isEmpty()
public boolean isEncode()
true
.public boolean isFieldEncoded(FieldDef fieldDef)
fieldDef
- the fieldpublic boolean isInnerDataSet()
public boolean isUpdateIndexOnChange()
public LinkedHashMap<String,Boolean> parseOrderByString(String orderBy)
orderBy
- the order by stringpublic void removeDataSetChangeListener(DataSetChangeListener dataSetChangeListener)
dataSetChangeListener
- the data set change listenerpublic void removeField(FieldDef fieldDef)
fieldDef
- the fieldpublic void setAdditionalInfo(String value)
value
- the new additional infopublic void setConnection(Connection value)
value
- the new connectionpublic void setData(DataSetData value)
value
- the new datapublic void setDataSetIndex(Map<String,DataSetRecord> value)
value
- the indexpublic void setDisplayFunctions(Map<String,TypedKeyValue<String,String>> functions)
functions
- the functionspublic void setDisplayKeyField(String value)
value
- the new the "display name" for the key field.public void setDriver(Driver value)
value
- the new driverpublic void setEncode(boolean value)
true
.value
- the new encodepublic void setField(FieldDef fieldDef)
fieldDef
- the new fieldpublic void setFieldAttr(FieldDef fieldDef, String name, String value)
fieldDef
- the fieldname
- the attribute's namevalue
- the attribute's valuepublic void setFields(DataSetFields value)
value
- the valuepublic void setFieldValue(DataSetRecord record, int index, Object value)
record
- the recordindex
- the index of the fieldvalue
- the valuepublic void setFieldValue(DataSetRecord record, String name, Object value)
record
- the recordname
- the name of the fieldvalue
- the valuepublic void setValue(DataSetRecord record, String name, Object value, int... type)
record
- DataSetRecord the recordname
- String the name of the fieldvalue
- Object the new field valuetype
- int the optional type of the fieldpublic void setFieldValue(int row, int col, Object value)
row
- the index of the recordcol
- the index of the fieldvalue
- the valuepublic void setFieldValue(int row, String name, Object value)
row
- the index of the recordname
- the name of the fieldvalue
- the valuepublic void setFilter(String filter) throws Exception
Example: col1 = 'test' and col2 = 'xyz'
filter
- the filterException
- the exceptionpublic void setInnerDataSet(boolean innerDataSet, DataSet parent)
innerDataSet
- the innerDataSet to setparent
- the parentpublic void setKeyFields(String value)
value
- The new names of the key fieldspublic void setName(String value)
value
- the new namepublic void setOwnerName(String value)
value
- the new owner namepublic void setRecord(DataSetRecord record, int row)
record
- the recordrow
- the index of the recordpublic void setRowSorter(DataSetRowSorter rowSorter)
rowSorter
- the new data set row sorterpublic void setSourceDriver(Driver value)
value
- the new source driverpublic void setSourceTableName(String value)
value
- the new source table namepublic void setSupportsSorting(boolean value)
value
- the new value for the supports sorting flagpublic void setTableName(String value)
value
- the new table namepublic void setUpdateIndexOnChange(boolean value)
value
- the new value for the "update index on change event" flagpublic void setVariables(Map<String,Variable> value)
value
- the valuepublic void sortByFieldIndex(List<TypedKeyValue<Integer,DataSetData.SortType>> orderBy)
orderBy
- the order by listpublic void sortByFieldName(List<TypedKeyValue<String,DataSetData.SortType>> orderBy)
orderBy
- the order by listpublic void sortByString(String orderBy)
orderBy
- the "order by" stringpublic boolean structureEquals(DataSet dataSet)
dataSet
- the data setpublic boolean supportsSorting()
public void updateFieldsWithSpaces()
public void updateIndexOnAdd(DataSetRecord currentRow)
currentRow
- the recordpublic void updateIndexOnDelete(DataSetRecord currentRow)
currentRow
- the recordpublic Object getActualData()
public void setActualData(Object actualData)
actualData
- the new actual datapublic String getFileNameToRead()
public void setFileNameToRead(String fileNameToRead)
fileNameToRead
- the new file name to readpublic String getFileNameToWrite()
public void setFileNameToWrite(String fileNameToWrite)
fileNameToWrite
- the new file name to writepublic long getAddedRecords()
public String getDataObjectToRead()
public void setDataObjectToRead(String objectToRead)
objectToRead
- Stringpublic DataSetRecord getCurrentRecord()
public void setCurrentRecord(DataSetRecord currentRecord)
currentRecord
- the new current recordpublic TypedKeyValue<List<String>,List<String>> updateFromMetadata(LinkedHashMap<String,FieldDef> metadata, boolean source, boolean dest, boolean create, boolean alter, boolean orderAndType, boolean typeOnly, ListHashMap<String,Variable> variables)
metadata
- the metadatasource
- the source has more fields than destinationdest
- the destination has more fields than sourcecreate
- the destination must be recreated if it does not have all the
fields which are in the sourcealter
- the alterorderAndType
- the order and typetypeOnly
- the type onlyvariables
- the variablespublic List<FieldDef> getSortedFields()
public boolean isValidationFailed()
public void setValidationFailed(boolean validationFailed)
validationFailed
- the new validation failedpublic String getUuid()
public DataSet getParentDataSet()
public void setParentDataSet(DataSet parentDataSet)
parentDataSet
- the new parent data setpublic DataSetRecord getParentDataSetRecord()
public void setParentDataSetRecord(DataSetRecord parentDataSetRecord)
parentDataSetRecord
- the new parent data set recordCopyright © 2010-2020 Toolsverse. All Rights Reserved.