|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jopendocument.dom.ODDocument org.jopendocument.dom.spreadsheet.SpreadSheet
public class SpreadSheet
A calc document.
Method Summary | |
---|---|
Sheet |
addSheet(int index,
String name)
Adds an empty sheet. |
Sheet |
addSheet(String name)
|
static SpreadSheet |
create(int sheetCount,
int colCount,
int rowCount)
|
static SpreadSheet |
create(XMLFormatVersion ns,
int sheetCount,
int colCount,
int rowCount)
|
static SpreadSheet |
createEmpty(TableModel t)
|
static SpreadSheet |
createEmpty(TableModel t,
XMLFormatVersion ns)
|
static SpreadSheet |
createFromFile(File f)
|
static File |
export(TableModel t,
File f,
XMLFormatVersion ns)
Export the passed data to file. |
protected static String |
formatSheetName(String n)
|
static SpreadSheet |
get(ODPackage fd)
This method should be avoided, use ODPackage.getSpreadSheet() . |
Cell<SpreadSheet> |
getCellAt(String ref)
Return the cell at the passed address. |
Sheet |
getFirstSheet()
|
Range |
getRange(String name)
Get a global named range. |
Set<String> |
getRangesNames()
All global ranges defined in this document. |
Sheet |
getSheet(int i)
|
Sheet |
getSheet(String name)
|
Sheet |
getSheet(String name,
boolean mustExist)
Return the first sheet with the passed name. |
int |
getSheetCount()
|
SheetTableModel.MutableTableModel<SpreadSheet> |
getTableModel(String name)
Return a view of the passed range. |
org.jdom.xpath.XPath |
getXPath(String p)
|
protected static String |
parseSheetName(String n)
|
Tuple2<Sheet,Point> |
resolve(String ref)
Resolve a cell address. |
Methods inherited from class org.jopendocument.dom.ODDocument |
---|
getBody, getContentDocument, getEpoch, getEpoch, getFormatVersion, getPackage, getVersion, saveAs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SpreadSheet createFromFile(File f) throws IOException
IOException
public static SpreadSheet get(ODPackage fd)
ODPackage.getSpreadSheet()
.
fd
- a package.
public static SpreadSheet createEmpty(TableModel t)
public static SpreadSheet createEmpty(TableModel t, XMLFormatVersion ns)
public static SpreadSheet create(int sheetCount, int colCount, int rowCount)
public static SpreadSheet create(XMLFormatVersion ns, int sheetCount, int colCount, int rowCount)
public static File export(TableModel t, File f, XMLFormatVersion ns) throws IOException
t
- the data to export.f
- where to export, if the extension is missing (or wrong) the correct one will be
added, eg "dir/data".ns
- the version of XML.
IOException
- if the file can't be saved.protected static final String parseSheetName(String n)
protected static final String formatSheetName(String n)
public final Set<String> getRangesNames()
Table.getRangesNames()
public final Range getRange(String name)
name
- the name of the range.
null
if the passed name doesn't exist.getRangesNames()
,
Table.getRange(String)
public final SheetTableModel.MutableTableModel<SpreadSheet> getTableModel(String name)
name
- a global named range.
null
if it doesn't exist.getRange(String)
,
Table.getMutableTableModel(Point, Point)
public final Cell<SpreadSheet> getCellAt(String ref)
ref
- the full address, eg "$sheet.A12".
public final Tuple2<Sheet,Point> resolve(String ref)
ref
- an OpenDocument cell address (see 9.2.1 of OpenDocument-v1.2-cs01-part1), e.g.
"table.B2".
public org.jdom.xpath.XPath getXPath(String p) throws org.jdom.JDOMException
org.jdom.JDOMException
public int getSheetCount()
public final Sheet getFirstSheet()
public Sheet getSheet(int i)
public Sheet getSheet(String name)
public Sheet getSheet(String name, boolean mustExist) throws NoSuchElementException
name
- the name of a sheet.mustExist
- what to do when no match is found : true
to throw an exception,
false
to return null.
null
if mustExist
is
false
and no match is found.
NoSuchElementException
- if mustExist
is true
and no match is
found.public final Sheet addSheet(int index, String name)
index
- where to add the new sheet.name
- the name of the new sheet.
public final Sheet addSheet(String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |