com.lowagie.text.rtf

Class RtfElement

public class RtfElement extends Object implements RtfBasicElement

RtfElement is the base class for all RTF Element classes Version: $Id: RtfElement.java,v 1.8 2004/12/14 15:14:44 blowagie Exp $

Author: Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
protected RtfDocumentdocument
The RtfDocument this RtfElement belongs to
protected booleaninHeader
Whether this RtfElement is in a header
protected booleaninTable
Whether this RtfElement is in a table
Constructor Summary
RtfElement(RtfDocument doc)
Constructs a RtfElement belonging to the specified RtfDocument.
Method Summary
byte[]intToByteArray(int i)
Transforms an integer into its String representation and then returns the bytes of that string.
booleanisInTable()
Gets whether this RtfElement is in a table
voidsetInHeader(boolean inHeader)
Sets whether this RtfElement is in a header
voidsetInTable(boolean inTable)
Sets whether this RtfElement is in a table
voidsetRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfElement belongs to
byte[]write()
Returns the content of the RtfElement in a byte array.

Field Detail

document

protected RtfDocument document
The RtfDocument this RtfElement belongs to

inHeader

protected boolean inHeader
Whether this RtfElement is in a header

inTable

protected boolean inTable
Whether this RtfElement is in a table

Constructor Detail

RtfElement

public RtfElement(RtfDocument doc)
Constructs a RtfElement belonging to the specified RtfDocument.

Parameters: doc The RtfDocument this RtfElement belongs to

Method Detail

intToByteArray

public byte[] intToByteArray(int i)
Transforms an integer into its String representation and then returns the bytes of that string.

Parameters: i The integer to convert

Returns: A byte array representing the integer

isInTable

public boolean isInTable()
Gets whether this RtfElement is in a table

Returns: Whether this RtfElement is in a table

setInHeader

public void setInHeader(boolean inHeader)
Sets whether this RtfElement is in a header

Parameters: inHeader True if this RtfElement is in a header, false otherwise

setInTable

public void setInTable(boolean inTable)
Sets whether this RtfElement is in a table

Parameters: inTable True if this RtfElement is in a table, false otherwise

setRtfDocument

public void setRtfDocument(RtfDocument doc)
Sets the RtfDocument this RtfElement belongs to

Parameters: doc The RtfDocument to use

write

public byte[] write()
Returns the content of the RtfElement in a byte array.

Returns: An empty byte array