public class NameHandle extends Object
get a handle to the Cells in a Name
set the default formatting for a Name
WorkBookHandle,
WorkSheetHandle,
FormulaHandle| Modifier | Constructor and Description |
|---|---|
protected |
NameHandle(Name c,
WorkBookHandle myb)
Create a NameHandle from an internal Name record
|
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
org.json.JSONObject |
getJSONCellRange()
Returns a JSON object in the same format as
CellRange.getJSON(). |
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
|
public NameHandle(String namestr, CellRange cr)
Name - of the Range, the CellRange referenced by the Nameprotected NameHandle(Name c, WorkBookHandle myb)
c - myb - 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 intopublic Handle getScope() throws WorkSheetNotFoundException
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 Namepublic void deleteRow(int idxcol)
throws Exception
the - column to use as unique indexExceptionpublic void updateRow(Object[] objarr, int idxcol) throws Exception
an - array of Objects to update existingthe - column to use as unique indexExceptionpublic void addRow(Object[] objarr) throws Exception
an - array of Objects to insert at last rownExceptionpublic 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 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 tagpublic String getCellRangeXML()
public CellHandle[] getCells() throws CellNotFoundException
CellNotFoundExceptionpublic CellRange[] getCellRanges() throws Exception
Exceptionpublic WorkSheetHandle[] getReferencedSheets() throws WorkSheetNotFoundException
WorkSheetNotFoundExceptionpublic Object getCalculatedValue() throws FunctionNotSupportedException
FunctionNotSupportedExceptionpublic boolean setLocationLocked(String loc, boolean l)
location - of the Cell Reference to be locked/unlockedlock - status settingpublic String getJSON()
public String getJSON(boolean celldata)
whether - to return cell datapublic org.json.JSONObject getJSONCellRange()
CellRange.getJSON().public String get2DSheetName()
Copyright © 2002–2019 Starter Inc.. All rights reserved.