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

public abstract class PrometheusSheetDataItem<T extends PrometheusDataItem> extends Object
SheetDataItem class for accessing a sheet that is related to a data type.
Author:
Tony Washer
  • Field Details

  • Constructor Details

    • PrometheusSheetDataItem

      protected PrometheusSheetDataItem(PrometheusSheetReader pReader, String pRange)
      Constructor for a load operation.
      Parameters:
      pReader - the spreadsheet reader
      pRange - the range to load
    • PrometheusSheetDataItem

      protected PrometheusSheetDataItem(PrometheusSheetWriter pWriter, String pRange)
      Constructor for a write operation.
      Parameters:
      pWriter - the spreadsheet writer
      pRange - the range to create
  • Method Details

    • getLastItem

      protected T getLastItem()
      Obtain the last loaded item.
      Returns:
      the item
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setDataList

      protected void setDataList(PrometheusDataList<T> pList)
      Set the DataList.
      Parameters:
      pList - the Data list
    • loadSpreadSheet

      public void loadSpreadSheet() throws OceanusException
      Load the DataItems from a spreadsheet.
      Throws:
      OceanusException - on error
    • writeSpreadSheet

      protected void writeSpreadSheet() throws OceanusException
      Write the DataItems to a spreadsheet.
      Throws:
      OceanusException - on error
    • loadSecureValues

      protected abstract PrometheusDataValues loadSecureValues() throws OceanusException
      Load secure item from spreadsheet.
      Returns:
      the secure values
      Throws:
      OceanusException - on error
    • insertSecureItem

      protected void insertSecureItem(T pItem) throws OceanusException
      Insert secure item into spreadsheet.
      Parameters:
      pItem - the item
      Throws:
      OceanusException - on error
    • postProcessOnLoad

      protected void postProcessOnLoad() throws OceanusException
      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

      protected void nameRange() throws OceanusException
      Name the basic range.
      Throws:
      OceanusException - on error
    • nameColumnRange

      protected void nameColumnRange(int pOffset, String pName) throws OceanusException
      Name the column range.
      Parameters:
      pOffset - offset of column
      pName - name of range
      Throws:
      OceanusException - on error
    • applyDataValidation

      public void applyDataValidation(int pOffset, String pList) throws OceanusException
      Apply Data Validation.
      Parameters:
      pOffset - offset of column
      pList - name of validation range
      Throws:
      OceanusException - on error
    • freezeTitles

      protected void freezeTitles()
      Freeze titles.
    • applyDataFilter

      protected void applyDataFilter(int pOffset) throws OceanusException
      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

      protected Integer loadInteger(int pOffset) throws OceanusException
      Access an integer from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the integer
      Throws:
      OceanusException - on error
    • loadLong

      protected Long loadLong(int pOffset) throws OceanusException
      Access a long from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the long
      Throws:
      OceanusException - on error
    • loadBoolean

      protected Boolean loadBoolean(int pOffset)
      Access a boolean from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the date
    • loadDate

      protected OceanusDate loadDate(int pOffset) throws OceanusException
      Access a date from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the date
      Throws:
      OceanusException - on error
    • loadMoney

      protected OceanusMoney loadMoney(int pOffset) throws OceanusException
      Access a money value from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the money
      Throws:
      OceanusException - on error
    • loadPrice

      protected OceanusPrice loadPrice(int pOffset) throws OceanusException
      Access a price value from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the price
      Throws:
      OceanusException - on error
    • loadRate

      protected OceanusRate loadRate(int pOffset) throws OceanusException
      Access a rate value from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the rate
      Throws:
      OceanusException - on error
    • loadUnits

      protected OceanusUnits loadUnits(int pOffset) throws OceanusException
      Access a units value from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the units
      Throws:
      OceanusException - on error
    • loadRatio

      protected OceanusRatio loadRatio(int pOffset) throws OceanusException
      Access a ratio value from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the ratio
      Throws:
      OceanusException - on error
    • loadString

      protected String loadString(int pOffset)
      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

      protected char[] loadChars(int pOffset) throws OceanusException
      Access a char array from the WorkSheet.
      Parameters:
      pOffset - the column offset
      Returns:
      the char array
      Throws:
      OceanusException - on error
    • writeInteger

      protected void writeInteger(int pOffset, Integer pValue) throws OceanusException
      Write an integer to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pValue - the integer
      Throws:
      OceanusException - on error
    • writeLong

      protected void writeLong(int pOffset, Long pValue) throws OceanusException
      Write an integer to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pValue - the integer
      Throws:
      OceanusException - on error
    • writeBoolean

      protected void writeBoolean(int pOffset, Boolean pValue) throws OceanusException
      Write a boolean to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pValue - the boolean
      Throws:
      OceanusException - on error
    • writeDate

      protected void writeDate(int pOffset, OceanusDate pValue) throws OceanusException
      Write a date to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pValue - the date
      Throws:
      OceanusException - on error
    • writeDecimal

      protected void writeDecimal(int pOffset, OceanusDecimal pValue) throws OceanusException
      Write a decimal to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pValue - the number
      Throws:
      OceanusException - on error
    • writeHeader

      protected void writeHeader(int pOffset, String pHeader) throws OceanusException
      Write a Header to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pHeader - the header text
      Throws:
      OceanusException - on error
    • writeString

      protected void writeString(int pOffset, String pValue) throws OceanusException
      Write a string to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pValue - the string
      Throws:
      OceanusException - on error
    • writeBytes

      protected void writeBytes(int pOffset, byte[] pBytes) throws OceanusException
      Write a byte array to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pBytes - the byte array
      Throws:
      OceanusException - on error
    • writeChars

      protected void writeChars(int pOffset, char[] pChars) throws OceanusException
      Write a char array to the WorkSheet.
      Parameters:
      pOffset - the column offset
      pChars - the char array
      Throws:
      OceanusException - on error
    • getRowValues

      protected PrometheusDataValues getRowValues(String pName) throws OceanusException
      Obtain row values.
      Parameters:
      pName - the name of the item
      Returns:
      the row values.
      Throws:
      OceanusException - on error