Class SpreadsheetColumn

java.lang.Object
org.eclipse.epsilon.emc.spreadsheets.SpreadsheetColumn
Direct Known Subclasses:
ExcelColumn

public abstract class SpreadsheetColumn extends Object
This class represents a column of a worksheet. Each column must belong to a worksheet and have a known, valid index. A valid index is greater than returned by SpreadsheetWorksheet#getColumnStartingIndex().
Author:
Martins Francis
  • Field Details

  • Constructor Details

  • Method Details

    • validateConstructorArguments

      protected void validateConstructorArguments(SpreadsheetWorksheet worksheet, int index)
      This method ensures 1) given worksheet is not null 2) index is less than value returned by SpreadsheetWorksheet#getColumnStartingIndex() - otherwise an IllegalArgumentException is thrown.
      Parameters:
      worksheet -
      index -
    • getWorksheet

      public SpreadsheetWorksheet getWorksheet()
      Returns:
      the worksheet this column belongs to
    • getIndex

      public int getIndex()
      Returns:
      the index of the column
    • getName

      public String getName()
      Returns:
      the name of the column
    • getAlias

      public String getAlias()
      Returns:
      the alias of the column
    • getDataType

      public SpreadsheetDataType getDataType()
      Returns:
      the data type of the column
    • isMany

      public boolean isMany()
      Returns:
      the multiplicity of the column i.e. whether it may contain multiple delimiter-separated values
    • isNotMany

      public boolean isNotMany()
      Returns:
      true if this column may not store multiple values in a single cell
    • getDelimiter

      public String getDelimiter()
      Returns:
      the delimiter used for separating the individual cell values. This is useful if a column may contain multiple values
    • setName

      public void setName(String name)
      Parameters:
      name - the name of the column
    • setAlias

      public void setAlias(String alias)
      Parameters:
      alias - the alias of the column
    • setDataType

      public void setDataType(SpreadsheetDataType dataType)
      Parameters:
      dataType - the data type of the column
    • setMany

      public void setMany(boolean many)
      Parameters:
      many - the multiplicity of the column
    • setDelimiter

      public void setDelimiter(String delimiter)
      Parameters:
      delimiter - the delimiter used for separating the values stored in individual cells of the column
    • isIdentifiableBy

      public boolean isIdentifiableBy(String identifier)
      Column can be identified either by its name, alias or prefixed column index
      Parameters:
      identifier -
      Returns:
      true if column can be identified by the identifier, false otherwise
    • getPrefixedIndex

      public String getPrefixedIndex()
      This method returns the index of this column prefixed by SpreadsheetConstants.PREFIX_COLUMN.
      Returns:
      prefixed index
    • isValidIndex

      public boolean isValidIndex(String identifier)
      This method checks if the index embedded within the provided prefixed column index is equal to the index of this column i.e. it will always return true if identifier is equal to the output of getPrefixedIndex().
      Parameters:
      identifier -
      Returns:
      true if index of the column equals the embedded index
    • getIdentifier

      public String getIdentifier()
      Returns:
      an identifier of the column. If name is set then it is returned, otherwise if alias is set then it is returned. If neither is set then prefixed column index is returned
    • toString

      public String toString()
      Overrides:
      toString in class Object