Package org.apache.poi.hssf.usermodel
Class HSSFHyperlink
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFHyperlink
-
-
Field Summary
Fields Modifier and Type Field Description protected HyperlinkType
link_type
If we create a new hyperlink remember its typeprotected HyperlinkRecord
record
Low-level record object that stores the actual hyperlink data
-
Constructor Summary
Constructors Modifier Constructor Description protected
HSSFHyperlink(HyperlinkType type)
Construct a new hyperlink This method is internal to be used only byHSSFCreationHelper.createHyperlink(HyperlinkType)
.protected
HSSFHyperlink(HyperlinkRecord record)
Initialize the hyperlink by aHyperlinkRecord
recordprotected
HSSFHyperlink(Hyperlink other)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
java.lang.String
getAddress()
Hyperlink address.int
getFirstColumn()
Return the column of the first cell that contains the hyperlinkint
getFirstRow()
Return the row of the first cell that contains the hyperlinkjava.lang.String
getLabel()
Return text label for this hyperlinkint
getLastColumn()
Return the column of the last cell that contains the hyperlinkint
getLastRow()
Return the row of the last cell that contains the hyperlinkjava.lang.String
getShortFilename()
java.lang.String
getTextMark()
HyperlinkType
getType()
Return the type of this hyperlinkHyperlinkType
getTypeEnum()
Deprecated.usegetType()
insteadint
hashCode()
void
setAddress(java.lang.String address)
Hyperlink address.void
setFirstColumn(int col)
Set the column of the first cell that contains the hyperlinkvoid
setFirstRow(int row)
Set the row of the first cell that contains the hyperlinkvoid
setLabel(java.lang.String label)
Sets text label for this hyperlinkvoid
setLastColumn(int col)
Set the column of the last cell that contains the hyperlinkvoid
setLastRow(int row)
Set the row of the last cell that contains the hyperlinkvoid
setShortFilename(java.lang.String shortFilename)
Convenience method equivalent tosetAddress(String)
void
setTextMark(java.lang.String textMark)
Convenience method equivalent tosetAddress(String)
-
-
-
Field Detail
-
record
protected final HyperlinkRecord record
Low-level record object that stores the actual hyperlink data
-
link_type
protected final HyperlinkType link_type
If we create a new hyperlink remember its type
-
-
Constructor Detail
-
HSSFHyperlink
@Internal(since="3.15 beta 3") protected HSSFHyperlink(HyperlinkType type)
Construct a new hyperlink This method is internal to be used only byHSSFCreationHelper.createHyperlink(HyperlinkType)
.- Parameters:
type
- the type of hyperlink to create
-
HSSFHyperlink
protected HSSFHyperlink(HyperlinkRecord record)
Initialize the hyperlink by aHyperlinkRecord
record- Parameters:
record
-
-
HSSFHyperlink
protected HSSFHyperlink(Hyperlink other)
-
-
Method Detail
-
getFirstRow
public int getFirstRow()
Return the row of the first cell that contains the hyperlink- Specified by:
getFirstRow
in interfaceHyperlink
- Returns:
- the 0-based row of the cell that contains the hyperlink
-
setFirstRow
public void setFirstRow(int row)
Set the row of the first cell that contains the hyperlink- Specified by:
setFirstRow
in interfaceHyperlink
- Parameters:
row
- the 0-based row of the first cell that contains the hyperlink
-
getLastRow
public int getLastRow()
Return the row of the last cell that contains the hyperlink- Specified by:
getLastRow
in interfaceHyperlink
- Returns:
- the 0-based row of the last cell that contains the hyperlink
-
setLastRow
public void setLastRow(int row)
Set the row of the last cell that contains the hyperlink- Specified by:
setLastRow
in interfaceHyperlink
- Parameters:
row
- the 0-based row of the last cell that contains the hyperlink
-
getFirstColumn
public int getFirstColumn()
Return the column of the first cell that contains the hyperlink- Specified by:
getFirstColumn
in interfaceHyperlink
- Returns:
- the 0-based column of the first cell that contains the hyperlink
-
setFirstColumn
public void setFirstColumn(int col)
Set the column of the first cell that contains the hyperlink- Specified by:
setFirstColumn
in interfaceHyperlink
- Parameters:
col
- the 0-based column of the first cell that contains the hyperlink
-
getLastColumn
public int getLastColumn()
Return the column of the last cell that contains the hyperlink- Specified by:
getLastColumn
in interfaceHyperlink
- Returns:
- the 0-based column of the last cell that contains the hyperlink
-
setLastColumn
public void setLastColumn(int col)
Set the column of the last cell that contains the hyperlink- Specified by:
setLastColumn
in interfaceHyperlink
- Parameters:
col
- the 0-based column of the last cell that contains the hyperlink
-
getAddress
public java.lang.String getAddress()
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.- Specified by:
getAddress
in interfaceHyperlink
- Returns:
- the address of this hyperlink
-
getTextMark
public java.lang.String getTextMark()
-
setTextMark
public void setTextMark(java.lang.String textMark)
Convenience method equivalent tosetAddress(String)
- Parameters:
textMark
- the place in worksheet this hyperlink refers to, e.g. 'Target Sheet'!A1'
-
getShortFilename
public java.lang.String getShortFilename()
-
setShortFilename
public void setShortFilename(java.lang.String shortFilename)
Convenience method equivalent tosetAddress(String)
- Parameters:
shortFilename
- the path to a file this hyperlink points to, e.g. 'readme.txt'
-
setAddress
public void setAddress(java.lang.String address)
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.- Specified by:
setAddress
in interfaceHyperlink
- Parameters:
address
- the address of this hyperlink
-
getLabel
public java.lang.String getLabel()
Return text label for this hyperlink
-
setLabel
public void setLabel(java.lang.String label)
Sets text label for this hyperlink
-
getType
public HyperlinkType getType()
Return the type of this hyperlink- Specified by:
getType
in interfaceHyperlink
- Returns:
- the type of this hyperlink
- See Also:
HyperlinkType.forInt(int)
-
getTypeEnum
@Deprecated @Removal(version="4.2") public HyperlinkType getTypeEnum()
Deprecated.usegetType()
insteadReturn the type of this hyperlink- Specified by:
getTypeEnum
in interfaceHyperlink
- Returns:
- the type of this hyperlink
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
- Returns:
- whether the objects have the same HyperlinkRecord
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-