Package org.apache.poi.hssf.usermodel
Class HSSFHyperlink
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFHyperlink
-
- All Implemented Interfaces:
Duplicatable,Hyperlink,Hyperlink
public class HSSFHyperlink extends Object implements Hyperlink, Duplicatable
Represents an Excel hyperlink.
-
-
Field Summary
Fields Modifier and Type Field Description protected HyperlinkTypelink_typeIf we create a new hyperlink remember its typeprotected HyperlinkRecordrecordLow-level record object that stores the actual hyperlink data
-
Constructor Summary
Constructors Modifier Constructor Description protectedHSSFHyperlink(HyperlinkType type)Construct a new hyperlink This method is internal to be used only byHSSFCreationHelper.createHyperlink(HyperlinkType).protectedHSSFHyperlink(HyperlinkRecord record)Initialize the hyperlink by aHyperlinkRecordrecordprotectedHSSFHyperlink(Hyperlink other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duplicatablecopy()booleanequals(Object other)StringgetAddress()Hyperlink address.intgetFirstColumn()Return the column of the first cell that contains the hyperlinkintgetFirstRow()Return the row of the first cell that contains the hyperlinkStringgetLabel()Return text label for this hyperlinkintgetLastColumn()Return the column of the last cell that contains the hyperlinkintgetLastRow()Return the row of the last cell that contains the hyperlinkStringgetShortFilename()StringgetTextMark()HyperlinkTypegetType()Return the type of this hyperlinkinthashCode()voidsetAddress(String address)Hyperlink address.voidsetFirstColumn(int col)Set the column of the first cell that contains the hyperlinkvoidsetFirstRow(int row)Set the row of the first cell that contains the hyperlinkvoidsetLabel(String label)Sets text label for this hyperlinkvoidsetLastColumn(int col)Set the column of the last cell that contains the hyperlinkvoidsetLastRow(int row)Set the row of the last cell that contains the hyperlinkvoidsetShortFilename(String shortFilename)Convenience method equivalent tosetAddress(String)voidsetTextMark(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 aHyperlinkRecordrecord
-
HSSFHyperlink
protected HSSFHyperlink(Hyperlink other)
-
-
Method Detail
-
getFirstRow
public int getFirstRow()
Return the row of the first cell that contains the hyperlink- Specified by:
getFirstRowin 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:
setFirstRowin 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:
getLastRowin 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:
setLastRowin 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:
getFirstColumnin 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:
setFirstColumnin 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:
getLastColumnin 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:
setLastColumnin interfaceHyperlink- Parameters:
col- the 0-based column of the last cell that contains the hyperlink
-
getAddress
public String getAddress()
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.- Specified by:
getAddressin interfaceHyperlink- Returns:
- the address of this hyperlink
-
getTextMark
public String getTextMark()
-
setTextMark
public void setTextMark(String textMark)
Convenience method equivalent tosetAddress(String)- Parameters:
textMark- the place in worksheet this hyperlink refers to, e.g. 'Target Sheet'!A1'
-
getShortFilename
public String getShortFilename()
-
setShortFilename
public void setShortFilename(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(String address)
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.- Specified by:
setAddressin interfaceHyperlink- Parameters:
address- the address of this hyperlink
-
getLabel
public String getLabel()
Return text label for this hyperlink
-
setLabel
public void setLabel(String label)
Sets text label for this hyperlink
-
getType
public HyperlinkType getType()
Return the type of this hyperlink
-
copy
public Duplicatable copy()
- Specified by:
copyin interfaceDuplicatable- Returns:
- a new HSSFHyperlink based on this
- Since:
- POI 5.1.0
-
equals
public boolean equals(Object other)
-
-