Package io.keikai.api.model.impl
Class BookImpl
java.lang.Object
io.keikai.api.model.impl.BookImpl
- All Implemented Interfaces:
Book,Serializable
- Since:
- 3.0.0
- Author:
- dennis
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.keikai.api.model.Book
Book.BookType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClones a new book.booleanGets the book nameget the internal model object to do advanced operation
Note : operate on internal object will not automatically update SpreadsheetgetLock()Get the read-write lock of this bookintintintGets the number of sheetgetRef()Gets share scope of this bookGets sheet by sheet namegetSheetAt(int index) Gets sheet by indexintgetSheetIndex(Sheet sheet) Gets the index of sheetgetType()Gets the book typebyte[]Returns the workbook's VBA macro project binary (xl/vbaProject.bin) preserved from a macro-enabled (.xlsm) import, ornullwhen the workbook carries no macros.inthashCode()booleanhasNameRange(String name) check if this book has named rangevoidsetShareScope(String scope) Sets share scope of this book, the possible value is "desktop","session","application"voidsetVbaProject(byte[] vbaProject) Installs (or, with anull/empty array, clears) the workbook's VBA macro project binary so a subsequent.xlsmexport carries these bytes and Excel can run the macros.
-
Constructor Details
-
BookImpl
-
-
Method Details
-
getNative
-
getInternalBook
Description copied from interface:Bookget the internal model object to do advanced operation
Note : operate on internal object will not automatically update Spreadsheet- Specified by:
getInternalBookin interfaceBook- Returns:
-
getRef
-
hashCode
public int hashCode() -
equals
-
getBookName
Description copied from interface:BookGets the book name- Specified by:
getBookNamein interfaceBook- Returns:
- tge book name
-
getType
Description copied from interface:BookGets the book type -
getVbaProject
public byte[] getVbaProject()Description copied from interface:BookReturns the workbook's VBA macro project binary (xl/vbaProject.bin) preserved from a macro-enabled (.xlsm) import, ornullwhen the workbook carries no macros. The bytes are the raw OLE2 macro container; Keikai does not parse them. KEIKAI-501.The default implementation returns
nullso thatBookimplementations that predate macro support stay source-compatible (mirrorsSBook.getVbaProject()).- Specified by:
getVbaProjectin interfaceBook- Returns:
- the VBA project bytes, or
nullif there are no macros
-
setVbaProject
public void setVbaProject(byte[] vbaProject) Description copied from interface:BookInstalls (or, with anull/empty array, clears) the workbook's VBA macro project binary so a subsequent.xlsmexport carries these bytes and Excel can run the macros. KEIKAI-501.The default implementation is a no-op so that
Bookimplementations that predate macro support stay source-compatible (mirrorsSBook.setVbaProject(byte[])).- Specified by:
setVbaProjectin interfaceBook- Parameters:
vbaProject- the VBA project bytes, ornull/empty to clear
-
getSheetIndex
Description copied from interface:BookGets the index of sheet- Specified by:
getSheetIndexin interfaceBook- Returns:
- the index of sheet or -1 if not found
-
getNumberOfSheets
public int getNumberOfSheets()Description copied from interface:BookGets the number of sheet- Specified by:
getNumberOfSheetsin interfaceBook- Returns:
- the number of sheet
-
getSheetAt
Description copied from interface:BookGets sheet by index- Specified by:
getSheetAtin interfaceBook- Parameters:
index- index of sheet- Returns:
-
getSheet
Description copied from interface:BookGets sheet by sheet name -
hasNameRange
Description copied from interface:Bookcheck if this book has named range- Specified by:
hasNameRangein interfaceBook- Parameters:
name- the name to check- Returns:
- true if it has a range of the name
-
getMaxRows
public int getMaxRows()- Specified by:
getMaxRowsin interfaceBook- Returns:
- the maximum number of usable rows in each sheet
-
getMaxColumns
public int getMaxColumns()- Specified by:
getMaxColumnsin interfaceBook- Returns:
- the maximum number of usable column in each sheet
-
getLock
Description copied from interface:BookGet the read-write lock of this book -
cloneBook
Description copied from interface:BookClones a new book.
-