Class PrometheusSheetDataItem<T extends PrometheusDataItem>
java.lang.Object
io.github.tonywasher.joceanus.prometheus.sheets.PrometheusSheetDataItem<T>
- Type Parameters:
T- the data type
- Direct Known Subclasses:
PrometheusSheetControlData,PrometheusSheetControlKey,PrometheusSheetControlKeySet,PrometheusSheetDataKeySet,PrometheusSheetEncrypted
SheetDataItem class for accessing a sheet that is related to a data type.
- Author:
- Tony Washer
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrometheusSheetDataItem(PrometheusSheetReader pReader, String pRange) Constructor for a load operation.protectedPrometheusSheetDataItem(PrometheusSheetWriter pWriter, String pRange) Constructor for a write operation. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyDataFilter(int pOffset) Freeze titles.voidapplyDataValidation(int pOffset, String pList) Apply Data Validation.protected voidFreeze titles.protected abstract intDetermine last active column.protected TObtain the last loaded item.protected PrometheusDataValuesgetRowValues(String pName) Obtain row values.protected voidinsertSecureItem(T pItem) Insert secure item into spreadsheet.protected BooleanloadBoolean(int pOffset) Access a boolean from the WorkSheet.protected byte[]loadBytes(int pOffset) Access a byte array from the WorkSheet.protected char[]loadChars(int pOffset) Access a char array from the WorkSheet.protected OceanusDateloadDate(int pOffset) Access a date from the WorkSheet.protected IntegerloadInteger(int pOffset) Access an integer from the WorkSheet.protected LongloadLong(int pOffset) Access a long from the WorkSheet.protected OceanusMoneyloadMoney(int pOffset) Access a money value from the WorkSheet.protected OceanusPriceloadPrice(int pOffset) Access a price value from the WorkSheet.protected OceanusRateloadRate(int pOffset) Access a rate value from the WorkSheet.protected OceanusRatioloadRatio(int pOffset) Access a ratio value from the WorkSheet.protected abstract PrometheusDataValuesLoad secure item from spreadsheet.voidLoad the DataItems from a spreadsheet.protected StringloadString(int pOffset) Access a string from the WorkSheet.protected OceanusUnitsloadUnits(int pOffset) Access a units value from the WorkSheet.protected voidnameColumnRange(int pOffset, String pName) Name the column range.protected voidName the basic range.protected voidnewRow()Create a new row.protected voidPostProcess on load.protected voidsetBooleanColumn(int pOffset) Set Boolean column.protected voidsetDataList(PrometheusDataList<T> pList) Set the DataList.protected voidsetDateColumn(int pOffset) Set Date column.protected voidsetHiddenColumn(int pOffset) Set Hidden column.protected voidsetIntegerColumn(int pOffset) Set Integer column.protected voidsetMoneyColumn(int pOffset) Set Money column.protected voidsetPriceColumn(int pOffset) Set Price column.protected voidsetRateColumn(int pOffset) Set Rate column.protected voidsetRatioColumn(int pOffset) Set Ratio column.protected voidsetStringColumn(int pOffset) Set String column.protected voidsetUnitsColumn(int pOffset) Set Units column.toString()protected voidwriteBoolean(int pOffset, Boolean pValue) Write a boolean to the WorkSheet.protected voidwriteBytes(int pOffset, byte[] pBytes) Write a byte array to the WorkSheet.protected voidwriteChars(int pOffset, char[] pChars) Write a char array to the WorkSheet.protected voidwriteDate(int pOffset, OceanusDate pValue) Write a date to the WorkSheet.protected voidwriteDecimal(int pOffset, OceanusDecimal pValue) Write a decimal to the WorkSheet.protected voidwriteHeader(int pOffset, String pHeader) Write a Header to the WorkSheet.protected voidwriteInteger(int pOffset, Integer pValue) Write an integer to the WorkSheet.protected voidWrite an integer to the WorkSheet.protected voidWrite the DataItems to a spreadsheet.protected voidwriteString(int pOffset, String pValue) Write a string to the WorkSheet.
-
Field Details
-
COL_ID
protected static final int COL_IDID column.- See Also:
-
-
Constructor Details
-
PrometheusSheetDataItem
Constructor for a load operation.- Parameters:
pReader- the spreadsheet readerpRange- the range to load
-
PrometheusSheetDataItem
Constructor for a write operation.- Parameters:
pWriter- the spreadsheet writerpRange- the range to create
-
-
Method Details
-
getLastItem
Obtain the last loaded item.- Returns:
- the item
-
toString
-
setDataList
Set the DataList.- Parameters:
pList- the Data list
-
loadSpreadSheet
Load the DataItems from a spreadsheet.- Throws:
OceanusException- on error
-
writeSpreadSheet
Write the DataItems to a spreadsheet.- Throws:
OceanusException- on error
-
loadSecureValues
Load secure item from spreadsheet.- Returns:
- the secure values
- Throws:
OceanusException- on error
-
insertSecureItem
Insert secure item into spreadsheet.- Parameters:
pItem- the item- Throws:
OceanusException- on error
-
postProcessOnLoad
PostProcess on load.- Throws:
OceanusException- on error
-
getLastColumn
protected abstract int getLastColumn()Determine last active column.- Returns:
- the last active column
-
newRow
protected void newRow()Create a new row. -
nameRange
Name the basic range.- Throws:
OceanusException- on error
-
nameColumnRange
Name the column range.- Parameters:
pOffset- offset of columnpName- name of range- Throws:
OceanusException- on error
-
applyDataValidation
Apply Data Validation.- Parameters:
pOffset- offset of columnpList- name of validation range- Throws:
OceanusException- on error
-
freezeTitles
protected void freezeTitles()Freeze titles. -
applyDataFilter
Freeze titles.- Parameters:
pOffset- column offset to freeze at- Throws:
OceanusException- on error
-
setHiddenColumn
protected void setHiddenColumn(int pOffset) Set Hidden column.- Parameters:
pOffset- the offset of the column
-
setDateColumn
protected void setDateColumn(int pOffset) Set Date column.- Parameters:
pOffset- the offset of the column
-
setStringColumn
protected void setStringColumn(int pOffset) Set String column.- Parameters:
pOffset- the offset of the column
-
setMoneyColumn
protected void setMoneyColumn(int pOffset) Set Money column.- Parameters:
pOffset- the offset of the column
-
setPriceColumn
protected void setPriceColumn(int pOffset) Set Price column.- Parameters:
pOffset- the offset of the column
-
setUnitsColumn
protected void setUnitsColumn(int pOffset) Set Units column.- Parameters:
pOffset- the offset of the column
-
setRateColumn
protected void setRateColumn(int pOffset) Set Rate column.- Parameters:
pOffset- the offset of the column
-
setRatioColumn
protected void setRatioColumn(int pOffset) Set Ratio column.- Parameters:
pOffset- the offset of the column
-
setBooleanColumn
protected void setBooleanColumn(int pOffset) Set Boolean column.- Parameters:
pOffset- the offset of the column
-
setIntegerColumn
protected void setIntegerColumn(int pOffset) Set Integer column.- Parameters:
pOffset- the offset of the column
-
loadInteger
Access an integer from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the integer
- Throws:
OceanusException- on error
-
loadLong
Access a long from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the long
- Throws:
OceanusException- on error
-
loadBoolean
Access a boolean from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the date
-
loadDate
Access a date from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the date
- Throws:
OceanusException- on error
-
loadMoney
Access a money value from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the money
- Throws:
OceanusException- on error
-
loadPrice
Access a price value from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the price
- Throws:
OceanusException- on error
-
loadRate
Access a rate value from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the rate
- Throws:
OceanusException- on error
-
loadUnits
Access a units value from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the units
- Throws:
OceanusException- on error
-
loadRatio
Access a ratio value from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the ratio
- Throws:
OceanusException- on error
-
loadString
Access a string from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the string
-
loadBytes
protected byte[] loadBytes(int pOffset) Access a byte array from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the byte array
-
loadChars
Access a char array from the WorkSheet.- Parameters:
pOffset- the column offset- Returns:
- the char array
- Throws:
OceanusException- on error
-
writeInteger
Write an integer to the WorkSheet.- Parameters:
pOffset- the column offsetpValue- the integer- Throws:
OceanusException- on error
-
writeLong
Write an integer to the WorkSheet.- Parameters:
pOffset- the column offsetpValue- the integer- Throws:
OceanusException- on error
-
writeBoolean
Write a boolean to the WorkSheet.- Parameters:
pOffset- the column offsetpValue- the boolean- Throws:
OceanusException- on error
-
writeDate
Write a date to the WorkSheet.- Parameters:
pOffset- the column offsetpValue- the date- Throws:
OceanusException- on error
-
writeDecimal
Write a decimal to the WorkSheet.- Parameters:
pOffset- the column offsetpValue- the number- Throws:
OceanusException- on error
-
writeHeader
Write a Header to the WorkSheet.- Parameters:
pOffset- the column offsetpHeader- the header text- Throws:
OceanusException- on error
-
writeString
Write a string to the WorkSheet.- Parameters:
pOffset- the column offsetpValue- the string- Throws:
OceanusException- on error
-
writeBytes
Write a byte array to the WorkSheet.- Parameters:
pOffset- the column offsetpBytes- the byte array- Throws:
OceanusException- on error
-
writeChars
Write a char array to the WorkSheet.- Parameters:
pOffset- the column offsetpChars- the char array- Throws:
OceanusException- on error
-
getRowValues
Obtain row values.- Parameters:
pName- the name of the item- Returns:
- the row values.
- Throws:
OceanusException- on error
-