|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.xssf.usermodel.XSSFName
public final class XSSFName
Represents a defined named range in a SpreadsheetML workbook.
Defined names are descriptive text that is used to represents a cell, range of cells, formula, or constant value.
Use easy-to-understand names, such as Products, to refer to hard to understand ranges, such as Sales!C20:C30
.
XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sh = wb.createSheet("Sheet1"); //applies to the entire workbook XSSFName name1 = wb.createName(); name1.setNameName("FMLA"); name1.setRefersToFormula("Sheet1!$B$3"); //applies to Sheet1 XSSFName name2 = wb.createName(); name2.setNameName("SheetLevelName"); name2.setComment("This name is scoped to Sheet1"); name2.setLocalSheetId(0); name2.setRefersToFormula("Sheet1!$B$3");
Field Summary | |
---|---|
static java.lang.String |
BUILTIN_CONSOLIDATE_AREA
A built-in defined name that refers to a consolidation area |
static java.lang.String |
BUILTIN_CRITERIA
A built-in defined name that refers to a range containing the criteria values to be used in applying an advanced filter to a range of data |
static java.lang.String |
BUILTIN_DATABASE
A built-in defined name that specified that the range specified is from a database data source |
static java.lang.String |
BUILTIN_EXTRACT
this defined name refers to the range containing the filtered output values resulting from applying an advanced filter criteria to a source range |
static java.lang.String |
BUILTIN_FILTER_DB
?an be one of the following this defined name refers to a range to which an advanced filter has been applied. |
static java.lang.String |
BUILTIN_PRINT_AREA
A built-in defined name that specifies the workbook's print area |
static java.lang.String |
BUILTIN_PRINT_TITLE
A built-in defined name that specifies the row(s) or column(s) to repeat at the top of each printed page. |
static java.lang.String |
BUILTIN_SHEET_TITLE
A built-in defined name that refers to a sheet title. |
Constructor Summary | |
---|---|
protected |
XSSFName(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName name,
XSSFWorkbook workbook)
Creates an XSSFName object - called internally by XSSFWorkbook. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compares this name to the specified object. |
java.lang.String |
getComment()
Returns the comment the user provided when the name was created. |
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName |
getCTName()
Returns the underlying named range object |
boolean |
getFunction()
Indicates that the defined name refers to a user-defined function. |
int |
getFunctionGroupId()
Returns the function group index if the defined name refers to a function. |
int |
getLocalSheetId()
Returns the sheet index this name applies to. |
java.lang.String |
getNameName()
Returns the name that will appear in the user interface for the defined name. |
java.lang.String |
getRefersToFormula()
Returns the reference of this named range, such as Sales!C20:C30. |
java.lang.String |
getSheetName()
Get the sheets name which this named range is referenced to |
int |
hashCode()
|
boolean |
isDeleted()
Tests if this name points to a cell that no longer exists |
boolean |
isFunctionName()
Is the name refers to a user-defined function ? |
void |
setComment(java.lang.String comment)
Specifies the comment the user provided when the name was created. |
void |
setFunction(boolean value)
Indicates that the defined name refers to a user-defined function. |
void |
setFunctionGroupId(int functionGroupId)
Specifies the function group index if the defined name refers to a function. |
void |
setLocalSheetId(int sheetId)
Tell Excel that this name applies to the worksheet with the specified index instead of the entire workbook. |
void |
setNameName(java.lang.String name)
Sets the name that will appear in the user interface for the defined name. |
void |
setRefersToFormula(java.lang.String formulaText)
Sets the reference of this named range, such as Sales!C20:C30. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BUILTIN_PRINT_AREA
public static final java.lang.String BUILTIN_PRINT_TITLE
public static final java.lang.String BUILTIN_CRITERIA
public static final java.lang.String BUILTIN_EXTRACT
public static final java.lang.String BUILTIN_FILTER_DB
public static final java.lang.String BUILTIN_CONSOLIDATE_AREA
public static final java.lang.String BUILTIN_DATABASE
public static final java.lang.String BUILTIN_SHEET_TITLE
Constructor Detail |
---|
protected XSSFName(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName name, XSSFWorkbook workbook)
name
- - the xml bean that holds data represenring this defined name.workbook
- - the workbook object associated with the nameXSSFWorkbook.createName()
Method Detail |
---|
protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDefinedName getCTName()
public java.lang.String getNameName()
getNameName
in interface org.apache.poi.ss.usermodel.Name
public void setNameName(java.lang.String name)
setNameName
in interface org.apache.poi.ss.usermodel.Name
name
- name of this defined name
java.lang.IllegalArgumentException
- if the name is invalid or the workbook already contains this name (case-insensitive)public java.lang.String getRefersToFormula()
getRefersToFormula
in interface org.apache.poi.ss.usermodel.Name
public void setRefersToFormula(java.lang.String formulaText)
setRefersToFormula
in interface org.apache.poi.ss.usermodel.Name
formulaText
- the reference to set
java.lang.IllegalArgumentException
- if the specified reference is unparsablepublic boolean isDeleted()
isDeleted
in interface org.apache.poi.ss.usermodel.Name
public void setLocalSheetId(int sheetId)
sheetId
- the sheet index this name applies to, -1 unsets this property making the name workbook-globalpublic int getLocalSheetId()
public void setFunction(boolean value)
value
- true
indicates the name refers to a function.public boolean getFunction()
true
indicates the name refers to a function.public void setFunctionGroupId(int functionGroupId)
functionGroupId
- the function group index that defines the general category for the functionpublic int getFunctionGroupId()
public java.lang.String getSheetName()
getSheetName
in interface org.apache.poi.ss.usermodel.Name
public boolean isFunctionName()
isFunctionName
in interface org.apache.poi.ss.usermodel.Name
true
if this name refers to a user-defined functionpublic java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- the user comment for this named rangepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
true
if the argument is XSSFName and the
underlying CTDefinedName bean equals to the CTDefinedName representing this name
equals
in class java.lang.Object
o
- the object to compare this XSSFName
against.
true
if the XSSFName
are equal;
false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |