Name
Inheritance: java.lang.Object
public class Name
Represents a defined name for a range of cells.
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(0);
//Creating a named range
Range range = worksheet.getCells().createRange("B4", "G14");
//Setting the name of the named range
range.setName("TestRange");
//Saving the modified Excel file in default (that is Excel 2000) format
workbook.save("output.xls");
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getClass() | |
getComment() | Gets the comment of the name. |
getFullText() | Gets the name full text of the object with the scope setting. |
getR1C1RefersTo() | Gets a R1C1 reference of the Name. |
getRange() | Gets the range if this name refers to a range. |
getRange(boolean recalculate) | Gets the range if this name refers to a range |
getRange(int sheetIndex, int row, int column) | Gets the range if this name refers to a range. |
getRanges() | Gets all ranges referred by this name. |
getRanges(boolean recalculate) | Gets all ranges referred by this name. |
getReferredAreas(boolean recalculate) | Gets all references referred by this name. |
getRefersTo() | Returns or sets the formula that the name is defined to refer to, beginning with an equal sign. |
getRefersTo(boolean isR1C1, boolean isLocal) | Get the reference of this Name. |
getRefersTo(boolean isR1C1, boolean isLocal, int row, int column) | Get the reference of this Name based on specified cell. |
getSheetIndex() | Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based) |
getText() | Gets the name text of the object. |
hashCode() | |
isReferred() | Indicates whether this name is referred by other formulas. |
isVisible() | Indicates whether the name is visible. |
notify() | |
notifyAll() | |
setComment(String value) | Sets the comment of the name. |
setR1C1RefersTo(String value) | Sets a R1C1 reference of the Name. |
setRefersTo(String value) | Returns or sets the formula that the name is defined to refer to, beginning with an equal sign. |
setRefersTo(String refersTo, boolean isR1C1, boolean isLocal) | Set the reference of this Name. |
setSheetIndex(int value) | Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based) |
setText(String value) | Gets the name text of the object. |
setVisible(boolean value) | Indicates whether the name is visible. |
toString() | Returns a string represents the current Range object. |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getComment()
public String getComment()
Gets the comment of the name. Only applies for Excel 2007 or higher versions.
Returns: java.lang.String
getFullText()
public String getFullText()
Gets the name full text of the object with the scope setting.
Returns: java.lang.String
getR1C1RefersTo()
public String getR1C1RefersTo()
Gets a R1C1 reference of the Name.
Returns: java.lang.String
getRange()
public Range getRange()
Gets the range if this name refers to a range.
Returns: Range - The range.
getRange(boolean recalculate)
public Range getRange(boolean recalculate)
Gets the range if this name refers to a range
Parameters:
Parameter | Type | Description |
---|---|---|
recalculate | boolean | whether recalculate it if this name has been calculated before this invocation. |
Returns: Range - The range.
getRange(int sheetIndex, int row, int column)
public Range getRange(int sheetIndex, int row, int column)
Gets the range if this name refers to a range. If the reference of this name is not absolute, the range may be different for different cell.
Parameters:
Parameter | Type | Description |
---|---|---|
sheetIndex | int | The according sheet index. |
row | int | The according row index. |
column | int | The according column index |
Returns: Range - The range.
getRanges()
public Range[] getRanges()
Gets all ranges referred by this name.
Returns: com.aspose.cells.Range[] - All ranges.
getRanges(boolean recalculate)
public Range[] getRanges(boolean recalculate)
Gets all ranges referred by this name.
Parameters:
Parameter | Type | Description |
---|---|---|
recalculate | boolean | whether recalculate it if this name has been calculated before this invocation. |
Returns: com.aspose.cells.Range[] - All ranges.
getReferredAreas(boolean recalculate)
public ReferredArea[] getReferredAreas(boolean recalculate)
Gets all references referred by this name.
Parameters:
Parameter | Type | Description |
---|---|---|
recalculate | boolean | whether recalculate it if this name has been calculated before this invocation. |
Returns: com.aspose.cells.ReferredArea[] - All ranges.
getRefersTo()
public String getRefersTo()
Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
Returns: java.lang.String
getRefersTo(boolean isR1C1, boolean isLocal)
public String getRefersTo(boolean isR1C1, boolean isLocal)
Get the reference of this Name.
Parameters:
Parameter | Type | Description |
---|---|---|
isR1C1 | boolean | Whether the reference needs to be formatted as R1C1. |
isLocal | boolean | Whether the reference needs to be formatted by locale. |
Returns: java.lang.String
getRefersTo(boolean isR1C1, boolean isLocal, int row, int column)
public String getRefersTo(boolean isR1C1, boolean isLocal, int row, int column)
Get the reference of this Name based on specified cell.
Parameters:
Parameter | Type | Description |
---|---|---|
isR1C1 | boolean | Whether the reference needs to be formatted as R1C1. |
isLocal | boolean | Whether the reference needs to be formatted by locale. |
row | int | The row index of the cell. |
column | int | The column index of the cell. |
Returns: java.lang.String
getSheetIndex()
public int getSheetIndex()
Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
Returns: int
getText()
public String getText()
Gets the name text of the object.
Returns: java.lang.String
hashCode()
public native int hashCode()
Returns: int
isReferred()
public boolean isReferred()
Indicates whether this name is referred by other formulas.
Returns: boolean
isVisible()
public boolean isVisible()
Indicates whether the name is visible.
Returns: boolean
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setComment(String value)
public void setComment(String value)
Sets the comment of the name. Only applies for Excel 2007 or higher versions.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setR1C1RefersTo(String value)
public void setR1C1RefersTo(String value)
Sets a R1C1 reference of the Name.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setRefersTo(String value)
public void setRefersTo(String value)
Returns or sets the formula that the name is defined to refer to, beginning with an equal sign.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setRefersTo(String refersTo, boolean isR1C1, boolean isLocal)
public void setRefersTo(String refersTo, boolean isR1C1, boolean isLocal)
Set the reference of this Name.
Parameters:
Parameter | Type | Description |
---|---|---|
refersTo | java.lang.String | The reference. |
isR1C1 | boolean | Whether the reference is R1C1 format. |
isLocal | boolean | Whether the reference is locale formatted. |
setSheetIndex(int value)
public void setSheetIndex(int value)
Indicates this name belongs to Workbook or Worksheet. 0 = Global name, otherwise index to sheet (one-based)
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setText(String value)
public void setText(String value)
Gets the name text of the object.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setVisible(boolean value)
public void setVisible(boolean value)
Indicates whether the name is visible.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
toString()
public String toString()
Returns a string represents the current Range object.
Returns: java.lang.String -
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |