com.aspose.cells

Class HyperlinkCollection

  • java.lang.Object
  • All Implemented Interfaces:
    java.lang.Iterable
    public class HyperlinkCollection 
    extends CollectionBase

Encapsulates a collection of Hyperlink objects.

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();

//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.getWorksheets().get(0);

//Get Hyperlinks Collection
HyperlinkCollection hyperlinks = worksheet.getHyperlinks();

//Adding a hyperlink to a URL at "A1" cell
hyperlinks.add("A1", 1, 1, "http://www.aspose.com");

//Saving the Excel file
workbook.save("D:\\book1.xls");

Property Getters/Setters Summary
intgetCount()
Hyperlinkget(intindex)
Gets the Hyperlink element at the specified index.
 
Method Summary
intadd(intfirstRow, intfirstColumn, inttotalRows, inttotalColumns, java.lang.Stringaddress)
Adds a hyperlink to a specified cell or a range of cells.
intadd(java.lang.Objectvalue)
Reserved for internal use.
intadd(java.lang.StringcellName, inttotalRows, inttotalColumns, java.lang.Stringaddress)
Adds a hyperlink to a specified cell or a range of cells.
intadd(java.lang.StringstartCellName, java.lang.StringendCellName, java.lang.Stringaddress, java.lang.StringtextToDisplay, java.lang.StringscreenTip)
Adds a hyperlink to a specified cell or a range of cells.
voidclear()
Clears all hyperlinks.
booleancontains(java.lang.Objectvalue)
Reserved for internal use.
java.lang.Objectget(intindex)
Reserved for internal use.
intindexOf(java.lang.Objectvalue)
Reserved for internal use.
java.util.Iteratoriterator()
voidremoveAt(intindex)
Remove the hyperlink at the specified index.
 

    • Property Getters/Setters Detail

      • getCount

        public int getCount()
        
      • get

        public Hyperlink get(int index)
        
        Gets the Hyperlink element at the specified index.
        Parameters:
        index - The zero based index of the element.
        Returns:
        The element at the specified index.
    • Method Detail

      • add

        public int add(int firstRow, int firstColumn, int totalRows, int totalColumns, java.lang.String address)
        Adds a hyperlink to a specified cell or a range of cells.
        Parameters:
        firstRow - First row of the hyperlink range.
        firstColumn - First column of the hyperlink range.
        totalRows - Number of rows in this hyperlink range.
        totalColumns - Number of columns of this hyperlink range.
        address - Address of the hyperlink.
        Returns:
        Hyperlink object index.

        Example:

        Worksheet worksheet = excel.getWorksheets().get(0);
        worksheet.getHyperlinks().add("A4", 1, 1, "http://www.aspose.com");
        worksheet.getHyperlinks().add("A5", 1, 1, "c:\\book1.xls");
      • add

        public int add(java.lang.String cellName, int totalRows, int totalColumns, java.lang.String address)
        Adds a hyperlink to a specified cell or a range of cells.
        Parameters:
        cellName - Cell name.
        totalRows - Number of rows in this hyperlink range.
        totalColumns - Number of columns of this hyperlink range.
        address - Address of the hyperlink.
        Returns:
        Hyperlink object index.
      • add

        public int add(java.lang.String startCellName, java.lang.String endCellName, java.lang.String address, java.lang.String textToDisplay, java.lang.String screenTip)
        Adds a hyperlink to a specified cell or a range of cells.
        Parameters:
        startCellName - The top-left cell of the range.
        endCellName - The bottom-right cell of the range.
        address - Address of the hyperlink.
        textToDisplay - The text to be displayed for the specified hyperlink.
        screenTip - The screenTip text for the specified hyperlink.
        Returns:
        Hyperlink object index.
      • removeAt

        public void removeAt(int index)
        Remove the hyperlink at the specified index.
        Parameters:
        index - The zero based index of the element.
      • clear

        public void clear()
        Clears all hyperlinks.
      • iterator

        public java.util.Iterator iterator()
      • get

        public java.lang.Object get(int index)
        Reserved for internal use.
      • contains

        public boolean contains(java.lang.Object value)
        Reserved for internal use.
      • add

        public int add(java.lang.Object value)
        Reserved for internal use.
      • indexOf

        public int indexOf(java.lang.Object value)
        Reserved for internal use.