public abstract class SpreadsheetColumn extends Object
SpreadsheetWorksheet#getColumnStartingIndex()
.Modifier and Type | Field and Description |
---|---|
protected String |
alias |
protected SpreadsheetDataType |
dataType |
protected String |
delimiter |
protected int |
index |
protected boolean |
many |
protected String |
name |
protected SpreadsheetWorksheet |
worksheet |
Constructor and Description |
---|
SpreadsheetColumn(SpreadsheetWorksheet worksheet,
int index) |
Modifier and Type | Method and Description |
---|---|
String |
getAlias() |
SpreadsheetDataType |
getDataType() |
String |
getDelimiter() |
String |
getIdentifier() |
int |
getIndex() |
String |
getName() |
String |
getPrefixedIndex()
This method returns the index of this column prefixed by
SpreadsheetConstants.PREFIX_COLUMN.
|
SpreadsheetWorksheet |
getWorksheet() |
boolean |
isIdentifiableBy(String identifier)
Column can be identified either by its name, alias or prefixed column index
|
boolean |
isMany() |
boolean |
isNotMany() |
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.
|
void |
setAlias(String alias) |
void |
setDataType(SpreadsheetDataType dataType) |
void |
setDelimiter(String delimiter) |
void |
setMany(boolean many) |
void |
setName(String name) |
String |
toString() |
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. |
protected SpreadsheetWorksheet worksheet
protected int index
protected String name
protected String alias
protected SpreadsheetDataType dataType
protected boolean many
protected String delimiter
public SpreadsheetColumn(SpreadsheetWorksheet worksheet, int index)
protected void validateConstructorArguments(SpreadsheetWorksheet worksheet, int index)
SpreadsheetWorksheet#getColumnStartingIndex()
-
otherwise an IllegalArgumentException is thrown.worksheet
- index
- public SpreadsheetWorksheet getWorksheet()
public int getIndex()
public String getName()
public String getAlias()
public SpreadsheetDataType getDataType()
public boolean isMany()
public boolean isNotMany()
public String getDelimiter()
public void setName(String name)
name
- the name of the columnpublic void setAlias(String alias)
alias
- the alias of the columnpublic void setDataType(SpreadsheetDataType dataType)
dataType
- the data type of the columnpublic void setMany(boolean many)
many
- the multiplicity of the columnpublic void setDelimiter(String delimiter)
delimiter
- the delimiter used for separating the values stored in
individual cells of the columnpublic boolean isIdentifiableBy(String identifier)
identifier
- public String getPrefixedIndex()
public boolean isValidIndex(String identifier)
identifier
- public String getIdentifier()
Copyright © 2020. All rights reserved.