|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.extentech.ExtenXLS.NameHandle
public class NameHandle
The NameHandle provides access to a Named Range and its Cells.
Use the NameHandle to work with individual Named Ranges in an XLS file.
With a NameHandle you can:
get a handle to the Cells in a Name
set the default formatting for a Name
WorkBookHandle,
WorkSheetHandle,
FormulaHandle| Constructor Summary | |
|---|---|
NameHandle(String namestr,
CellRange cr)
Creates a new Named Range from a CellRange |
|
NameHandle(String name,
String location,
WorkBookHandle book)
Create a new named range in the workbook |
|
NameHandle(String namestr,
WorkBookHandle myb)
Deprecated. |
|
| Method Summary | |
|---|---|
void |
addCell(CellHandle cx)
add a cell to this named range |
void |
addRow(Object[] objarr)
add a row of cells to this named range |
void |
deleteRow(int idxcol)
deletes a row of cells in this named range, shifts subsequent rows up. |
String |
get2DSheetName()
return the sheetname for a 2D named range NOTE: Does not work for 3D ranges |
Object |
getCalculatedValue()
return the calculated value of this Name if it contains a parsed Expression (Formula) |
CellRange[] |
getCellRanges()
Get an Array of CellRanges, one per referenced WorkSheet. |
String |
getCellRangeXML()
gets the array of Cells in this Name |
String |
getCellRangeXML(boolean fragment)
gets the array of Cells in this Name NOTE: this method variation also returns the Sheetname for the name record if not null. |
CellHandle[] |
getCells()
gets the array of Cells in this Name |
String |
getExpandedXML()
|
String |
getExpressionString()
returns the name's formula String for the range definition |
String |
getJSON()
Return a JSON object representing this name Handle. |
String |
getJSON(boolean celldata)
Return a JSON object representing this name Handle. |
String |
getLocation()
get the referenced named cell range as string in standard excel syntax including sheetname, for instance "Sheet1!A1:Z255" |
String |
getName()
returns the name String for the range definition |
WorkSheetHandle[] |
getReferencedSheets()
Get WorkSheetHandles for all of the Boundsheets referenced in this NameHandle. |
Handle |
getScope()
Returns a handle to the object (either workbook or sheet) that is scoped to the name record Default scope is a WorkBookHandle, else the WorkSheetHandle is returned. |
String |
getXML()
Return an XML representation of this name record |
boolean |
remove()
removes this Named Range from the WorkBook. |
void |
setCreateBlanks(boolean b)
set whether the CellRanges referenced by the NameHandle will add blank records to the WorkBook for any missing Cells contained within the range. |
void |
setFormatId(int i)
sets the default format id for the Name's Cells |
void |
setLocation(String strloc)
set the referenced cells for the named range this reference should be in the standard excel syntax including sheetname, for instance "Sheet1!A1:Z255" |
boolean |
setLocationLocked(String loc,
boolean l)
Sets the location lock on the Cell Reference at the specified location Used to prevent updating of the Cell Reference when Cells are moved. |
void |
setName(String newname)
set the name String for the range definition |
void |
setScope(Handle scope)
Set the scope of this name to that of the handle passed in. |
String |
toString()
|
void |
updateRow(Object[] objarr,
int idxcol)
update a row of cells in this named range |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NameHandle(String namestr,
CellRange cr)
Name - of the Range, the CellRange referenced by the Name
public NameHandle(String namestr,
WorkBookHandle myb)
namestr - myb -
public NameHandle(String name,
String location,
WorkBookHandle book)
name - name that should be used to reference this named rangelocation - rangeDef Range of the cells for this named range, in excel syntax including sheet name, ie "Sheet1!A1:D1"book - WorkBookHandle to insert this named range into| Method Detail |
|---|
public Handle getScope()
throws com.extentech.formats.XLS.WorkSheetNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundExceptionpublic void setScope(Handle scope)
scope - Workbookhandle or WorksheetHandlepublic String getXML()
public String getExpandedXML()
public void setFormatId(int i)
int - Format Id for all Cells in Name
public void deleteRow(int idxcol)
throws Exception
the - column to use as unique index
Exception
public void updateRow(Object[] objarr,
int idxcol)
throws Exception
an - array of Objects to update existingthe - column to use as unique index
Exception
public void addRow(Object[] objarr)
throws Exception
an - array of Objects to insert at last rown
Exception
public void addCell(CellHandle cx)
throws Exception
cx -
Exceptionpublic void setLocation(String strloc)
public String getLocation()
public void setName(String newname)
String - definition namepublic String getName()
public String toString()
toString in class Objectpublic String getExpressionString()
public boolean remove()
public void setCreateBlanks(boolean b)
b - set whether to create blank records for missing Cellspublic String getCellRangeXML(boolean fragment)
fragment - whether to enclose result in NameHandle tag
public String getCellRangeXML()
public CellHandle[] getCells()
throws com.extentech.formats.XLS.CellNotFoundException
com.extentech.formats.XLS.CellNotFoundException
public CellRange[] getCellRanges()
throws Exception
Exception
public WorkSheetHandle[] getReferencedSheets()
throws com.extentech.formats.XLS.WorkSheetNotFoundException
com.extentech.formats.XLS.WorkSheetNotFoundException
public Object getCalculatedValue()
throws com.extentech.formats.XLS.FunctionNotSupportedException
com.extentech.formats.XLS.FunctionNotSupportedException
public boolean setLocationLocked(String loc,
boolean l)
location - of the Cell Reference to be locked/unlockedlock - status setting
public String getJSON()
public String getJSON(boolean celldata)
whether - to return cell data
public String get2DSheetName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||