FileDocCategorySizeDatePackage
TxInteractiveInfoAtom.javaAPI DocApache Poi 3.0.13682Thu May 31 18:45:28 BST 2007org.apache.poi.hslf.record

TxInteractiveInfoAtom

public class TxInteractiveInfoAtom extends RecordAtom
Tne atom that holds starting and ending character positions of a hyperlink
author
Yegor Kozlov

Fields Summary
private byte[]
_header
Record header.
private byte[]
_data
Record data.
Constructors Summary
protected TxInteractiveInfoAtom()
Constructs a brand new link related atom record.

        _header = new byte[8];
        _data = new byte[8];

        LittleEndian.putShort(_header, 2, (short)getRecordType());
        LittleEndian.putInt(_header, 4, _data.length);
    
protected TxInteractiveInfoAtom(byte[] source, int start, int len)
Constructs the link related atom record from its source data.

param
source the source data as a byte array.
param
start the start offset into the byte array.
param
len the length of the slice in the byte array.

        // Get the header.
        _header = new byte[8];
        System.arraycopy(source,start,_header,0,8);

        // Get the record data.
        _data = new byte[len-8];
        System.arraycopy(source,start+8,_data,0,len-8);

    
Methods Summary
public intgetEndIndex()
Gets the ending character position

return
the ending character position

        return LittleEndian.getInt(_data, 4);
    
public longgetRecordType()
Gets the record type.

return
the record type.

 return RecordTypes.TxInteractiveInfoAtom.typeID; 
public intgetStartIndex()
Gets the beginning character position

return
the beginning character position

        return LittleEndian.getInt(_data, 0);
    
public voidsetEndIndex(int idx)
Sets the ending character position

param
idx the ending character position

        LittleEndian.putInt(_data, 4, idx);
    
public voidsetStartIndex(int idx)
Sets the beginning character position

param
idx the beginning character position

        LittleEndian.putInt(_data, 0, idx);
    
public voidwriteOut(java.io.OutputStream out)
Write the contents of the record back, so it can be written to disk

param
out the output stream to write to.
throws
java.io.IOException if an error occurs.

        out.write(_header);
        out.write(_data);