HyperlinkCollection

Inheritance: java.lang.Object, com.aspose.cells.CollectionBase

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("book1.xls");

Methods

MethodDescription
add(int firstRow, int firstColumn, int totalRows, int totalColumns, String address)Adds a hyperlink to a specified cell or a range of cells.
add(Object o)Adds an item to the CollectionBase instance.
add(String cellName, int totalRows, int totalColumns, String address)Adds a hyperlink to a specified cell or a range of cells.
add(String startCellName, String endCellName, String address, String textToDisplay, String screenTip)Adds a hyperlink to a specified cell or a range of cells.
clear()Clears all hyperlinks.
contains(Object o)Return whether instance contains this object
equals(Object arg0)
get(int index)Gets the Hyperlink element at the specified index.
getClass()
getCount()Gets the number of elements contained in the CollectionBase instance.
hashCode()
indexOf(Object o)Determines the index of a specific item in the CollectionBase instance.
iterator()Returns an enumerator that iterates through the CollectionBase instance.
notify()
notifyAll()
removeAt(int index)Remove the hyperlink at the specified index in this collection.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

add(int firstRow, int firstColumn, int totalRows, int totalColumns, String address)

public int add(int firstRow, int firstColumn, int totalRows, int totalColumns, String address)

Adds a hyperlink to a specified cell or a range of cells.

Example

         //Instantiating a Workbook object
         Workbook excel = new Workbook();
         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");

Parameters:

ParameterTypeDescription
firstRowintFirst row of the hyperlink range.
firstColumnintFirst column of the hyperlink range.
totalRowsintNumber of rows in this hyperlink range.
totalColumnsintNumber of columns of this hyperlink range.
addressjava.lang.StringAddress of the hyperlink.

Returns: int - Hyperlink object index.

add(Object o)

public int add(Object o)

Adds an item to the CollectionBase instance.

Parameters:

ParameterTypeDescription
ojava.lang.ObjectThe Object to add to the CollectionBase instance.

Returns: int - The position into which the new element was inserted.

add(String cellName, int totalRows, int totalColumns, String address)

public int add(String cellName, int totalRows, int totalColumns, String address)

Adds a hyperlink to a specified cell or a range of cells.

Parameters:

ParameterTypeDescription
cellNamejava.lang.StringCell name.
totalRowsintNumber of rows in this hyperlink range.
totalColumnsintNumber of columns of this hyperlink range.
addressjava.lang.StringAddress of the hyperlink.

Returns: int - Hyperlink object index.

add(String startCellName, String endCellName, String address, String textToDisplay, String screenTip)

public int add(String startCellName, String endCellName, String address, String textToDisplay, String screenTip)

Adds a hyperlink to a specified cell or a range of cells.

Parameters:

ParameterTypeDescription
startCellNamejava.lang.StringThe top-left cell of the range.
endCellNamejava.lang.StringThe bottom-right cell of the range.
addressjava.lang.StringAddress of the hyperlink.
textToDisplayjava.lang.StringThe text to be displayed for the specified hyperlink.
screenTipjava.lang.StringThe screenTip text for the specified hyperlink.

Returns: int - Hyperlink object index.

clear()

public void clear()

Clears all hyperlinks.

contains(Object o)

public boolean contains(Object o)

Return whether instance contains this object

Parameters:

ParameterTypeDescription
ojava.lang.Objecttest object

Returns: boolean - Whether instance contains this object

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

get(int index)

public Hyperlink get(int index)

Gets the Hyperlink element at the specified index.

Parameters:

ParameterTypeDescription
indexintThe zero based index of the element.

Returns: Hyperlink - The element at the specified index.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCount()

public int getCount()

Gets the number of elements contained in the CollectionBase instance.

Returns: int - The number of elements contained in the CollectionBase instance.

hashCode()

public native int hashCode()

Returns: int

indexOf(Object o)

public int indexOf(Object o)

Determines the index of a specific item in the CollectionBase instance.

Parameters:

ParameterTypeDescription
ojava.lang.ObjectDetermines the index of a specific item in the CollectionBase instance.

Returns: int - The index of value if found in the list; otherwise, -1.

iterator()

public Iterator iterator()

Returns an enumerator that iterates through the CollectionBase instance.

Returns: java.util.Iterator - An iterator for the CollectionBase instance.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeAt(int index)

public void removeAt(int index)

Remove the hyperlink at the specified index in this collection.

Parameters:

ParameterTypeDescription
indexintThe zero based index of the element.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int