jxl.write.biff
Class HyperlinkRecord

java.lang.Object
  extended byjxl.biff.RecordData
      extended byjxl.biff.WritableRecordData
          extended byjxl.write.biff.HyperlinkRecord
All Implemented Interfaces:
ByteData
Direct Known Subclasses:
WritableHyperlink

public class HyperlinkRecord
extends WritableRecordData

A number record. This is stored as 8 bytes, as opposed to the 4 byte RK record


Field Summary
 
Fields inherited from class jxl.biff.WritableRecordData
maxRecordLength
 
Constructor Summary
protected HyperlinkRecord(Hyperlink h, WritableSheet s)
          Constructs this object from the readable spreadsheet
protected HyperlinkRecord(int col, int row, int lastcol, int lastrow, java.io.File file, java.lang.String desc)
          Constructs a File hyperlink to a range of cells
protected HyperlinkRecord(int col, int row, int lastcol, int lastrow, java.lang.String desc, WritableSheet s, int destcol, int destrow, int lastdestcol, int lastdestrow)
          Constructs a hyperlink to some cells within this workbook
protected HyperlinkRecord(int col, int row, int lastcol, int lastrow, java.net.URL url, java.lang.String desc)
          Constructs a URL hyperlink to a range of cells
 
Method Summary
 int getColumn()
          Returns the column number of the top left cell
 byte[] getData()
          Gets the binary data to be written to the output file
 java.io.File getFile()
          Returns the local file eferenced by this Hyperlink
 int getLastColumn()
          Returns the column number of the bottom right cell
 int getLastRow()
          Returns the row number of the bottom right cell
 Range getRange()
          Gets the range of cells which activate this hyperlink The get sheet index methods will all return -1, because the cells will all be present on the same sheet
 int getRow()
          Returns the row number of the top left cell
 java.net.URL getURL()
          Gets the URL referenced by this Hyperlink
 boolean isFile()
          Determines whether this is a hyperlink to a file
 boolean isLocation()
          Determines whether this is a hyperlink to a location in this workbook
 boolean isUNC()
          Determines whether this is a hyperlink to a UNC
 boolean isURL()
          Determines whether this is a hyperlink to a web resource
protected  void setContents(java.lang.String desc)
          Sets the description
 void setFile(java.io.File file)
          Sets the file activated by this hyperlink
protected  void setLocation(java.lang.String desc, WritableSheet sheet, int destcol, int destrow, int lastdestcol, int lastdestrow)
          Sets the location of the cells to be linked to within this workbook
 void setURL(java.net.URL url)
          Sets the URL of this hyperlink
 java.lang.String toString()
          A standard toString method
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HyperlinkRecord

protected HyperlinkRecord(Hyperlink h,
                          WritableSheet s)
Constructs this object from the readable spreadsheet


HyperlinkRecord

protected HyperlinkRecord(int col,
                          int row,
                          int lastcol,
                          int lastrow,
                          java.net.URL url,
                          java.lang.String desc)
Constructs a URL hyperlink to a range of cells

Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
url - the hyperlink
desc - the description

HyperlinkRecord

protected HyperlinkRecord(int col,
                          int row,
                          int lastcol,
                          int lastrow,
                          java.io.File file,
                          java.lang.String desc)
Constructs a File hyperlink to a range of cells

Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
file - the hyperlink
desc - the description

HyperlinkRecord

protected HyperlinkRecord(int col,
                          int row,
                          int lastcol,
                          int lastrow,
                          java.lang.String desc,
                          WritableSheet s,
                          int destcol,
                          int destrow,
                          int lastdestcol,
                          int lastdestrow)
Constructs a hyperlink to some cells within this workbook

Parameters:
col - the column containing this hyperlink
row - the row containing this hyperlink
lastcol - the last column which activates this hyperlink
lastrow - the last row which activates this hyperlink
desc - the contents of the cell which describe this hyperlink
destcol - the column number of the first destination linked cell
destrow - the row number of the first destination linked cell
lastdestcol - the column number of the last destination linked cell
lastdestrow - the row number of the last destination linked cell
Method Detail

isFile

public boolean isFile()
Determines whether this is a hyperlink to a file

Returns:
TRUE if this is a hyperlink to a file, FALSE otherwise

isUNC

public boolean isUNC()
Determines whether this is a hyperlink to a UNC

Returns:
TRUE if this is a hyperlink to a UNC, FALSE otherwise

isURL

public boolean isURL()
Determines whether this is a hyperlink to a web resource

Returns:
TRUE if this is a URL

isLocation

public boolean isLocation()
Determines whether this is a hyperlink to a location in this workbook

Returns:
TRUE if this is a link to an internal location

getRow

public int getRow()
Returns the row number of the top left cell

Returns:
the row number of this cell

getColumn

public int getColumn()
Returns the column number of the top left cell

Returns:
the column number of this cell

getLastRow

public int getLastRow()
Returns the row number of the bottom right cell

Returns:
the row number of this cell

getLastColumn

public int getLastColumn()
Returns the column number of the bottom right cell

Returns:
the column number of this cell

getURL

public java.net.URL getURL()
Gets the URL referenced by this Hyperlink

Returns:
the URL, or NULL if this hyperlink is not a URL

getFile

public java.io.File getFile()
Returns the local file eferenced by this Hyperlink

Returns:
the file, or NULL if this hyperlink is not a file

getData

public byte[] getData()
Gets the binary data to be written to the output file

Specified by:
getData in class WritableRecordData
Returns:
the data to write to file

toString

public java.lang.String toString()
A standard toString method

Returns:
the contents of this object as a string

getRange

public Range getRange()
Gets the range of cells which activate this hyperlink The get sheet index methods will all return -1, because the cells will all be present on the same sheet

Returns:
the range of cells which activate the hyperlink or NULL if this hyperlink has not been added to the sheet

setURL

public void setURL(java.net.URL url)
Sets the URL of this hyperlink

Parameters:
url - the url

setFile

public void setFile(java.io.File file)
Sets the file activated by this hyperlink

Parameters:
file - the file

setLocation

protected void setLocation(java.lang.String desc,
                           WritableSheet sheet,
                           int destcol,
                           int destrow,
                           int lastdestcol,
                           int lastdestrow)
Sets the location of the cells to be linked to within this workbook

Parameters:
desc - the label describing the link
sheet - the sheet containing the cells to be linked to
destcol - the column number of the first destination linked cell
destrow - the row number of the first destination linked cell
lastdestcol - the column number of the last destination linked cell
lastdestrow - the row number of the last destination linked cell

setContents

protected void setContents(java.lang.String desc)
Sets the description

Parameters:
desc - the description