Class SpreadsheetRow
- java.lang.Object
-
- org.eclipse.epsilon.emc.spreadsheets.SpreadsheetRow
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadsheetWorksheet
worksheet
-
Constructor Summary
Constructors Constructor Description SpreadsheetRow(SpreadsheetWorksheet worksheet)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<String>
getAllVisibleCellValues(SpreadsheetColumn column)
This method returns a list of every value contained by the cell.List<String>
getAllVisibleCellValues(SpreadsheetColumn column, boolean trim)
The purpose of this method is to return all visible values of the given cell.List<String>
getAllVisibleCellValuesAsIs(SpreadsheetColumn column)
This method returns a list of every value contained by the cell.SpreadsheetColumn
getColumn(String columnIdentifier)
SpreadsheetModel
getModel()
Set<SpreadsheetReference>
getReferencesBySource(SpreadsheetColumn column)
Set<SpreadsheetReference>
getReferencesByTarget(SpreadsheetColumn column)
abstract String
getVisibleCellValue(SpreadsheetColumn column)
The purpose of this method is to return the visible value stored by the given cell.SpreadsheetWorksheet
getWorksheet()
abstract void
overwriteCellValue(SpreadsheetColumn column, String value)
The purpose of this method is to overwrite the value of the cell.String
toString()
protected void
validateColumn(SpreadsheetColumn column)
protected void
writeManyVisibleValues(SpreadsheetColumn column, List<String> valuesToWrite)
This method writes the given values to the cell.protected void
writeOneVisibleValue(SpreadsheetColumn column, String valueToWrite)
This method writes the given value to the cell.void
writeVisibleCellValues(SpreadsheetColumn column, List<String> valuesToWrite)
The purpose of this method is to write the given values to the given cell.
-
-
-
Field Detail
-
worksheet
protected SpreadsheetWorksheet worksheet
-
-
Constructor Detail
-
SpreadsheetRow
public SpreadsheetRow(SpreadsheetWorksheet worksheet)
-
-
Method Detail
-
getModel
public SpreadsheetModel getModel()
-
getWorksheet
public SpreadsheetWorksheet getWorksheet()
-
getColumn
public SpreadsheetColumn getColumn(String columnIdentifier)
-
getReferencesBySource
public Set<SpreadsheetReference> getReferencesBySource(SpreadsheetColumn column)
-
getReferencesByTarget
public Set<SpreadsheetReference> getReferencesByTarget(SpreadsheetColumn column)
-
getVisibleCellValue
public abstract String getVisibleCellValue(SpreadsheetColumn column)
The purpose of this method is to return the visible value stored by the given cell. The 'visible value' means the value stored by the cell and observed when the row is viewed in the spreadsheet. This means any worksheet metadata shall be disregarded by this method.- Parameters:
column
-- Returns:
- the visible value of the cell
-
validateColumn
protected void validateColumn(SpreadsheetColumn column)
-
getAllVisibleCellValues
public List<String> getAllVisibleCellValues(SpreadsheetColumn column, boolean trim)
The purpose of this method is to return all visible values of the given cell. This means that cell multiplicity is accounted for when reading the cell however any other worksheet metadata information is disregarded. Whitespace around every cell value is removed before it is returned if specified to do so.- Parameters:
column
-trim
-- Returns:
- all visible values stored in the cell
-
getAllVisibleCellValuesAsIs
public List<String> getAllVisibleCellValuesAsIs(SpreadsheetColumn column)
This method returns a list of every value contained by the cell.- Parameters:
column
-- Returns:
- cell values
-
getAllVisibleCellValues
public List<String> getAllVisibleCellValues(SpreadsheetColumn column)
This method returns a list of every value contained by the cell. Each value is trimmed before adding to the list.- Parameters:
column
-- Returns:
- cell values, trimmed
-
overwriteCellValue
public abstract void overwriteCellValue(SpreadsheetColumn column, String value)
The purpose of this method is to overwrite the value of the cell.- Parameters:
column
-value
- the new value of the cell
-
writeVisibleCellValues
public void writeVisibleCellValues(SpreadsheetColumn column, List<String> valuesToWrite)
The purpose of this method is to write the given values to the given cell. If the column may contain multiple values then each value from the list is separated by column's delimiter before writing to the cell. If the column may contain only one value then only the first value from the list is written. Data type conformity is enforced if specified to do so in metadata configuration.- Parameters:
column
-valuesToWrite
-
-
writeManyVisibleValues
protected void writeManyVisibleValues(SpreadsheetColumn column, List<String> valuesToWrite)
This method writes the given values to the cell. Data type conformity is enforced for each value if applicable.- Parameters:
column
-valuesToWrite
-
-
writeOneVisibleValue
protected void writeOneVisibleValue(SpreadsheetColumn column, String valueToWrite)
This method writes the given value to the cell. Data type conformity is enforced if applicable.- Parameters:
column
-valueToWrite
-
-
-