Class WorkbookReference
public final class WorkbookReference
extends Object
Represents a reference to an external workbook. This class is immutable.
Constructor Summary
Constructors
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
boolean
Check if the workbook reference equals to another.
boolean
Check if the workbook reference equals to another.
Creates a workbook reference from file path.
Creates a workbook reference from workbook name.
Creates a workbook reference from a URI link to workbook.
The base directory that contains workbook.
The base uri that contains workbook.
int
Gets or sets the workbook id if the reference came from low-level storage of formulas.
The name of the workbook.
int
Gets hash code of the workbook reference.
Converts workbook reference to string.
Field Details
SupportsReferenceId
public static final boolean SupportsReferenceId
See Also:
Constructor Details
WorkbookReference
public WorkbookReference ()
Method Details
getBaseDirectory
public String getBaseDirectory ()
The base directory that contains workbook. If the value is not null
,Name
is the file name of workbook. If the value is empty, the path isthe root directory.
getBaseUri
The base uri that contains workbook. If the value is not null
, Name
is the file name ofworkbook. For example, the base uri of https://www.grapecity.com/file/example.xlsx is https://www.grapecity.com/file . The file name is example.xlsx .
getName
The name of the workbook. If the BaseDirectory
is not null
, represents the file name of the workbook.
getId
public int getId ()
Gets or sets the workbook id if the reference came from low-level storage of formulas. The default value is 0, which means the current workbook.
FromFilePath
Creates a workbook reference from file path.
Parameters:
workbookFullPath
- The full path of workbook. It must be a valid filepath.
Returns:
Workbook reference.
FromUri
Creates a workbook reference from a URI link to workbook.
Parameters:
uri
- A URI link to the workbook.
Returns:
The workbook reference.
FromName
Creates a workbook reference from workbook name.
Parameters:
name
- The name of the workbook. It can be different from file name.
Returns:
Workbook reference.
equals
public boolean equals (Object obj)
Check if the workbook reference equals to another.
Overrides:
equals
in class Object
Parameters:
obj
- Another workbook reference.
Returns:
equality.
equals
Check if the workbook reference equals to another.
Parameters:
other
- Another workbook reference.
Returns:
equality.
hashCode
public int hashCode ()
Gets hash code of the workbook reference.
Overrides:
hashCode
in class Object
Returns:
hash code.
toString
Converts workbook reference to string.
Overrides:
toString
in class Object
Returns:
string value.