olg.csv.base
Class AbstractSheetSettings<T extends AbstractSheetSettings<T>>

Package class diagram package AbstractSheetSettings
java.lang.Object
  extended by olg.csv.base.AbstractSheetSettings<T>
Type Parameters:
T - the concret settings type.
Direct Known Subclasses:
ODSSettings

public abstract class AbstractSheetSettings<T extends AbstractSheetSettings<T>>
extends Object

Settings Class for spreadsheet document reader and writer class.


Field Summary
protected  String beginAtColumn
          the index column from which begin row reading/writing.
protected  Integer beginAtRow
          the row from which begin the reading/writing. first row is 1.
static int DEFAULT_SHEETNUM
          Default sheet num on which read/write.
static boolean DEFAULT_WITHHEADERS
          Default with headers value.
protected  String endAtColumn
          The index column to which end the row reading/writing.
protected  Integer endAtRow
          The row to which ends the reading/writing.
protected  String sheetName
          The sheet name on which read.
protected  int sheetNum
          sheet num.
protected  boolean withHeaders
           
 
Constructor Summary
AbstractSheetSettings()
          Purpose default settings.
AbstractSheetSettings(int sheetNum, boolean withHeaders, Integer beginAtRow, Integer endAtRow, String beginAtColumn, String endAtColumn, String sheetName)
           
 
Method Summary
 String getBeginAtColumn()
           
 Integer getBeginAtRow()
           
 String getEndAtColumn()
          Returns the num of the last column to read if defined.
 Integer getEndAtRow()
          Returns the last row to read if defined.
 String getSheetName()
          Returns the sheet name.
 int getSheetNum()
           
 boolean isWithHeaders()
          indicate if the first row must be skipped on reading or if an headers line must be written on writing.
 T setBeginAtColumn(String beginAtColumn)
          Set from which column begin to read/write each line.
 T setBeginAtRow(Integer beginAtRow)
          Sets the row number where to begin reading or writing.
 T setEndAtColumn(String endAtColumn)
          Set to which column end reading each line.Only for reading.
 T setEndAtRow(Integer endAtRow)
          Set at which line end reading.Only for reading.
 T setSheetName(String sheetName)
          The desire sheet name.
 T setSheetNum(int sheetNum)
          Sets the sheet index in the sheets list of the document.
 T setWithHeaders(boolean withHeaders)
          Allows to skip headers line on reading or allows to write headers on writing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WITHHEADERS

public static final boolean DEFAULT_WITHHEADERS
Default with headers value.

See Also:
Constant Field Values

DEFAULT_SHEETNUM

public static final int DEFAULT_SHEETNUM
Default sheet num on which read/write.

See Also:
Constant Field Values

sheetNum

protected int sheetNum
sheet num.


withHeaders

protected boolean withHeaders

beginAtRow

protected Integer beginAtRow
the row from which begin the reading/writing. first row is 1.


endAtRow

protected Integer endAtRow
The row to which ends the reading/writing. Could be null.


beginAtColumn

protected String beginAtColumn
the index column from which begin row reading/writing.


endAtColumn

protected String endAtColumn
The index column to which end the row reading/writing.


sheetName

protected String sheetName
The sheet name on which read.

Constructor Detail

AbstractSheetSettings

public AbstractSheetSettings()
Purpose default settings.


AbstractSheetSettings

public AbstractSheetSettings(int sheetNum,
                             boolean withHeaders,
                             Integer beginAtRow,
                             Integer endAtRow,
                             String beginAtColumn,
                             String endAtColumn,
                             String sheetName)
Parameters:
sheetNum - if sheetName parameter is null,try to load sheet with this index in the sheet list.
withHeaders - Only for Reading. If true skip the first read line, considered as headers line.
beginAtRow - specify which line of the file, starts the reading or writing, If null, start at the first line
endAtRow - specify which line of the file ends the reading. If null, end at the last line. Only on reading process
beginAtColumn - specify which column of each line starts the reading or writing. Sheet cell number format('A', 'B', 'C',..., 'AA', ...) or integer Format.May be null, in this case start at the first column of each line.
endAtColumn - Specify which column of each line end reading. Sheet cell number format('A', 'B', 'C',..., 'AA', ...) or integer Format. May be null
sheetName - if specified, try to load sheet with this name (sheetNum parameter is ignored then redefined)
Method Detail

getSheetNum

public int getSheetNum()
Returns:
sheet index in the sheets list of the document

setSheetNum

public T setSheetNum(int sheetNum)
Sets the sheet index in the sheets list of the document.

Parameters:
sheetNum - the sheet index in the document.
Returns:
the current instance

isWithHeaders

public boolean isWithHeaders()
indicate if the first row must be skipped on reading or if an headers line must be written on writing.

Returns:
with headers or not.

setWithHeaders

public T setWithHeaders(boolean withHeaders)
Allows to skip headers line on reading or allows to write headers on writing.

Parameters:
withHeaders - indicate if the document has an header.
Returns:
the current instance

getBeginAtRow

public Integer getBeginAtRow()
Returns:
the row number where to begin reading or writing.

setBeginAtRow

public T setBeginAtRow(Integer beginAtRow)
Sets the row number where to begin reading or writing.

Parameters:
beginAtRow - May be null(the reading or writing begins at the first line of the document)
Returns:
the current instance

getEndAtRow

public Integer getEndAtRow()
Returns the last row to read if defined. Only for reading.

Returns:
the last row to read.

setEndAtRow

public T setEndAtRow(Integer endAtRow)
Set at which line end reading.Only for reading.

Parameters:
endAtRow - May be null(the reading ends at the last line of the document)
Returns:
the current instance

getBeginAtColumn

public String getBeginAtColumn()
Returns:
the num of the first column to read/write.

setBeginAtColumn

public T setBeginAtColumn(String beginAtColumn)
Set from which column begin to read/write each line.

Parameters:
beginAtColumn - May be null(each read or written line start at the first column)
Returns:
the current instance

getEndAtColumn

public String getEndAtColumn()
Returns the num of the last column to read if defined. Only for reading.

Returns:
the num of the last column to read.

setEndAtColumn

public T setEndAtColumn(String endAtColumn)
Set to which column end reading each line.Only for reading.

Parameters:
endAtColumn - May be null
Returns:
the current instance

getSheetName

public String getSheetName()
Returns the sheet name.

Returns:
the sheet name.

setSheetName

public T setSheetName(String sheetName)
The desire sheet name.

Parameters:
sheetName - the name of the sheet in the spreadsheet document.
Returns:
the current instance


Copyright © 2014. All Rights Reserved.