| Modifier and Type | Field and Description |
|---|---|
| private final HSSFWorkbook | |
| private final NameCommentRecord | |
| private final NameRecord |
| Access | Constructor and Description |
|---|---|
| pack-priv | HSSFName(HSSFWorkbook
workbook object associated with the sheet. book, NameRecord the Name Record name)Creates new HSSFName - called by HSSFWorkbook to create a name from scratch. |
| pack-priv | HSSFName(final HSSFWorkbook
workbook object associated with the sheet. book, final NameRecord the Name Record name, final NameCommentRecord the Name Comment Record, optional. comment)Creates new HSSFName - called by HSSFWorkbook to create a name from scratch. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the user comment for this named rangeImplements org. Returns the comment the user provided when the name was created. |
| public String | Returns: text name of this defined nameImplements org. Gets the name of the named range |
| public String | getRefersToFormula()
Implements org. Returns the formula that the name is defined to refer to. |
| public int | Returns: the sheet index this name applies to, -1 if this name applies to the entire workbookImplements org. Returns the sheet index this name applies to. |
| public String | Returns: sheet name, which this named range referred toImplements org. Get the sheets name which this named range is referenced to |
| public boolean | isDeleted()
Implements org. Checks if this name points to a cell that no longer exists |
| public boolean | Returns: true if this name is a function nameImplements org. Checks if this name is a function name |
| public boolean | Returns: true if this name is a hidden oneImplements org. Checks if this name is hidden, eg one of the built-in Excel internal names |
| public void | setComment(String
the user comment for this named range comment)Implements org. Sets the comment the user provided when the name was created. |
| public void | setFunction(boolean
true indicates the name refers to a function.Implements org. Indicates that the defined name refers to a user-defined function. |
| pack-priv void | setNameDefinition(Ptg[]
the sequence of ptgs)Ptgs for the formula.Sets the NameParsedFormula structure that specifies the formula for the defined name. |
| public void | setNameName(String
named range name to set nameName)Implements org. Sets the name of the named range The following is a list of syntax rules that you need to be aware of when you create and edit names. |
| public void | setRefersToFormula(String
the reference for this name formulaText)Implements org. Sets the formula that the name is defined to refer to. |
| public void | setSheetIndex(int
if greater than 0, the defined name is a local name and the value MUST be a 0-based index
to the collection of sheets as they appear in the workbook. index)Implements org. Specifies if the defined name is a local name, and if so, which sheet it is on. |
| public String | |
| private static void | validateName(String name)
https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4D0F13AC-53B7-422E-AFD2-ABD7FF379C64#bmsyntax_rules_for_names Valid characters: First character: { letter | underscore | backslash } Remaining characters: { letter | number | period | underscore } Cell shorthand: cannot be { "C" | "c" | "R" | "r" } Cell references disallowed: cannot be a cell reference $A$1 or R1C1 Spaces are not valid (follows from valid characters above) Name length: (XSSF-specific?) 255 characters maximum Case sensitivity: all names are case-insensitive Uniqueness: must be unique (for names with the same scope) |
| _book | back to summary |
|---|---|
| private final HSSFWorkbook _book | |
| _commentRec | back to summary |
|---|---|
| private final NameCommentRecord _commentRec | |
| _definedNameRec | back to summary |
|---|---|
| private final NameRecord _definedNameRec | |
| HSSFName | back to summary |
|---|---|
| pack-priv HSSFName(HSSFWorkbook book, NameRecord name) Creates new HSSFName - called by HSSFWorkbook to create a name from scratch.
| |
| HSSFName | back to summary |
|---|---|
| pack-priv HSSFName(final HSSFWorkbook book, final NameRecord name, final NameCommentRecord comment) Creates new HSSFName - called by HSSFWorkbook to create a name from scratch.
| |
| getComment | back to summary |
|---|---|
| public String getComment() Implements org. Returns the comment the user provided when the name was created. | |
| getNameName | back to summary |
|---|---|
| public String getNameName() Implements org. Doc from org. Gets the name of the named range | |
| getRefersToFormula | back to summary |
|---|---|
| public String getRefersToFormula() Implements org. Doc from org. Returns the formula that the name is defined to refer to. | |
| getSheetIndex | back to summary |
|---|---|
| public int getSheetIndex() Implements org. Returns the sheet index this name applies to.
| |
| getSheetName | back to summary |
|---|---|
| public String getSheetName() Implements org. Get the sheets name which this named range is referenced to | |
| isDeleted | back to summary |
|---|---|
| public boolean isDeleted() Implements org. Doc from org. Checks if this name points to a cell that no longer exists
| |
| isFunctionName | back to summary |
|---|---|
| public boolean isFunctionName() Implements org. Checks if this name is a function name
| |
| isHidden | back to summary |
|---|---|
| public boolean isHidden() Implements org. Checks if this name is hidden, eg one of the built-in Excel internal names
| |
| setComment | back to summary |
|---|---|
| public void setComment(String comment) Implements org. Sets the comment the user provided when the name was created. | |
| setFunction | back to summary |
|---|---|
| public void setFunction(boolean value) Implements org. Indicates that the defined name refers to a user-defined function. This attribute is used when there is an add-in or other code project associated with the file.
| |
| setNameDefinition | back to summary |
|---|---|
| pack-priv void setNameDefinition(Ptg[] ptgs) Sets the NameParsedFormula structure that specifies the formula for the defined name. | |
| setNameName | back to summary |
|---|---|
| public void setNameName(String nameName) Implements org. Sets the name of the named range The following is a list of syntax rules that you need to be aware of when you create and edit names.
A name must always be unique within its scope. POI prevents you from defining a name that is not unique within its scope. However you can use the same name in different scopes. Example:
| |
| setRefersToFormula | back to summary |
|---|---|
| public void setRefersToFormula(String formulaText) Implements org. Doc from org. Sets the formula that the name is defined to refer to. The following are representative examples:
| |
| setSheetIndex | back to summary |
|---|---|
| public void setSheetIndex(int index) Implements org. Specifies if the defined name is a local name, and if so, which sheet it is on.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| validateName | back to summary |
|---|---|
| private static void validateName(String name) https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4D0F13AC-53B7-422E-AFD2-ABD7FF379C64#bmsyntax_rules_for_names Valid characters: First character: { letter | underscore | backslash } Remaining characters: { letter | number | period | underscore } Cell shorthand: cannot be { "C" | "c" | "R" | "r" } Cell references disallowed: cannot be a cell reference $A$1 or R1C1 Spaces are not valid (follows from valid characters above) Name length: (XSSF-specific?) 255 characters maximum Case sensitivity: all names are case-insensitive Uniqueness: must be unique (for names with the same scope) | |