|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.presentation.stream.SpreadSheet
public abstract class SpreadSheet
Spreadsheet support broker.
Provides the basic functionality for Microsoft ® Spreadsheet support. This class designed as agent that facades functionality provided by other 3rd party tools. (A.k.a Jakarta POI.) The guaranteed functionality is expressed by this facade and will not changed in future. Any provided implementation may extend only. The movement that is provided by this broker is performed in two following ways:occupy
and
withdraw
methods should
enframe the binding the each table, this simplifies the movement between them. For more details see the
occupation
and withdrawal
procedures.
Additionally the broker provides the basic mark
/
rollback
functionality for processing the
alternative lexical branches (if any exists in used model).
SpreadSheetReader
,
SpreadSheetWriter
,
SpreadSheet.Locator
Nested Class Summary | |
---|---|
class |
SpreadSheet.Locator
Helper class that represents the location of cell within the workbook. |
Field Summary | |
---|---|
protected Stack |
ditches
Stack of borders of the spreading the tables has been read. |
protected SpreadSheet.Locator |
location
Location implementation instance. |
protected org.apache.poi.ss.usermodel.Workbook |
workbook
Liable 3rd party broker. |
Constructor Summary | |
---|---|
protected |
SpreadSheet(org.apache.poi.ss.usermodel.Workbook workbook)
Constructor with 3rd party workbook instance. |
Method Summary | |
---|---|
protected SpreadSheet.Locator |
calculateNext(SpreadSheet.Locator step)
Calculates the next location on the specified step movement. |
protected SpreadSheet.Locator |
getDitch()
Returns the current (i.e. last known) "ditch". |
SpreadSheet.Locator |
getLocation()
Returns the current location. |
protected String |
getSheetName(int idx)
Returns the sheet name. |
SpreadSheet.Locator |
mark()
Marks the location to which consequent rollback will restore the broker state. |
void |
next(String step)
Moves the current location on provided offset (i.e. |
SpreadSheet.Locator |
occupy()
Start the new spreading occupation. |
protected SpreadSheet.Locator |
parse(String address)
Returns the parsed address as location . |
protected abstract int |
resolveSheet(String name)
Returns the sheet index in workbook used. |
void |
rollback(SpreadSheet.Locator ditch)
Rollbacks the last known "ditch" to preliminary stored location. |
void |
setStartLocation(String start)
Sets the current location to specified address. |
void |
withdraw(SpreadSheet.Locator backPoint)
Returns the position in provided location and restore up the last occupied ditch. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.poi.ss.usermodel.Workbook workbook
protected SpreadSheet.Locator location
protected final Stack ditches
Constructor Detail |
---|
protected SpreadSheet(org.apache.poi.ss.usermodel.Workbook workbook)
workbook
.
workbook
- The workbook
implementation that will be used.Method Detail |
---|
public SpreadSheet.Locator getLocation()
location instance
that represents
the current position withing SpreadSheet.SpreadSheet.Locator
public void setStartLocation(String start)
start
- The address from where parsing of the SpreadSheet will start.getLocation()
public void next(String step)
step
).
Parses the provided string representation of offset and set the new location that is
calculated
. The scope of extension
is updated
by new location.
step
- The textual representation of step that need to
perform.public SpreadSheet.Locator occupy()
withdraw
. In fact prepares the
broker to do the subsequent spreading for sibling tables (i.e. ADS' CDTs). Before any spreading, the client
should call this method to be able fix the spreading by following
withdrawing
.
withdraw
.withdraw(biz.c24.io.api.presentation.stream.SpreadSheet.Locator)
public void withdraw(SpreadSheet.Locator backPoint)
backPoint
- The new location to where withdrawal should be performed.occupy()
public SpreadSheet.Locator mark()
rollback
will restore the broker state.
Returns the last known ditch clone for consequent restoring to the prevent state in case of lexical branch
failure. In military terms, the building of backbone defencive line in light of big probability of counter-attack
due lack of offencive capabilities.
public void rollback(SpreadSheet.Locator ditch)
mark "ditch"
to rollback on preliminary stored location thereby
restoring the last good known broker state during processing the alternative lexical state transition.
ditch
- The last known "ditch" to which it is need to restore the broker state.protected SpreadSheet.Locator parse(String address)
location
.
The address should conform the used cell reference style.
address
- The textual representation of address that need to
parse.
address
as location
instance
.protected SpreadSheet.Locator calculateNext(SpreadSheet.Locator step)
step
movement.
Realizes movement in following manner depends on provided step
:
provided step
is relative (i.e. moves withing current sheet scope), the
step
is interpreted as offset and increased by current location.provided step
is absolute (i.e. moves through sheets), the step
is
interpreted as new location and returned without changes.
step
- The requested step (i.e. the offset) on which movement need to do.
location
.protected SpreadSheet.Locator getDitch()
protected abstract int resolveSheet(String name)
name
is null
the current existing
sheet index is returned.
Note: Due difference in behavior during reading
and writing
: the writing supposes the sheet creation "on the fly", there is
needing to add the polymorphism for current sheet getter. So, details please see in corresponding
implementations.
name
- The requested sheet name, may be null
.
protected String getSheetName(int idx)
idx
- The index of sheet which name is requested.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |