|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object olg.csv.base.AbstractSheetReader
public abstract class AbstractSheetReader
Abstract class which embeds sheet reader characteristics.
Field Summary | |
---|---|
protected Integer |
beginAtColumn
First cell to read in each row. |
protected Integer |
beginAtRow
First row to read. |
protected Integer |
endAtColumn
Last cell to read in each row. |
protected Integer |
endAtRow
last row to read. |
protected int |
recordIndex
Record index. first is 1. |
protected int |
rowSize
Record size. |
protected String |
sheetName
Sheet name. |
protected int |
sheetNum
the sheet num. 0 is the first. |
protected boolean |
skipEmptyCell
Indicate if emtpy cells are skipping. |
protected boolean |
withHeaders
Indicate if an header row must be skipped. |
Constructor Summary | |
---|---|
AbstractSheetReader(AbstractSheetSettings<? extends AbstractSheetSettings<?>> settings)
|
Method Summary | |
---|---|
private void |
checkParameters(Integer beginAtRow,
Integer endAtRow,
String beginAtColumn,
String endAtColumn)
Check and set parameters. |
abstract void |
close()
|
protected abstract int |
defineRowSize()
Returns the expected rows length of each line. |
protected abstract void |
doOnInitSheet()
Method called by initSheet() to allow concret SheetReader to do
some stuff on its instanciation. |
protected abstract int |
getRows()
Get the row count of this sheet. |
String |
getSheetName()
Returns sheet name corresponding to the sheet this reader has opened. |
int |
getSheetNum()
Returns the index of the current sheet this reader has opened. |
boolean |
hasNext()
|
protected void |
initSheet()
Method to call by concret constructor to initialize some stuff. |
boolean |
isWithHeaders()
Indicates if the file has a headers line. |
Row |
next()
|
protected List<Cell> |
padding(List<Cell> cells,
int columnBegin,
int columnEnd)
Complete cell lists in parameter with empty cells. |
void |
remove()
Unsupported Operation. |
protected abstract Row |
setNext()
Returns the next Row. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean skipEmptyCell
protected int sheetNum
protected int recordIndex
protected int rowSize
protected String sheetName
protected boolean withHeaders
protected Integer beginAtRow
protected Integer endAtRow
protected Integer beginAtColumn
protected Integer endAtColumn
Constructor Detail |
---|
public AbstractSheetReader(AbstractSheetSettings<? extends AbstractSheetSettings<?>> settings)
settings
- the reader settings. Must not be null
.Method Detail |
---|
public final boolean hasNext()
hasNext
in interface Iterator<Row>
public final Row next()
next
in interface Iterator<Row>
public final void remove()
remove
in interface Iterator<Row>
public boolean isWithHeaders()
isWithHeaders
in interface IReader
public abstract void close()
close
in interface Closeable
protected abstract Row setNext()
protected abstract void doOnInitSheet() throws IOException
initSheet()
to allow concret SheetReader to do
some stuff on its instanciation.
IOException
- if I/O error occurs.protected List<Cell> padding(List<Cell> cells, int columnBegin, int columnEnd)
cells
- list to completecolumnBegin
- index colum from which begins the padding (inclusive)columnEnd
- index column to which ends the padding (exclusive).
public int getSheetNum()
public String getSheetName()
protected abstract int getRows()
protected void initSheet() throws IOException
IOException
- if I/O error occurs during initialization.doOnInitSheet()
protected abstract int defineRowSize()
private void checkParameters(Integer beginAtRow, Integer endAtRow, String beginAtColumn, String endAtColumn)
Throws IllegalArgumentException if one of these parameters.
beginAtRow
- the row index from which begins the reading. lines number
begin at 1endAtRow
- the last index to which ends the reading.beginAtColumn
- the cell num from which begins the row reading. columns begin
at 0. Could be in sheet cell format or a number.endAtColumn
- the cell num to which ends the row reading. Could be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |