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

ExObjList

public class ExObjList extends RecordContainer
This class holds the links to exernal objects referenced from the document.
author
Nick Burch

Fields Summary
private byte[]
_header
private static long
_type
private ExObjListAtom
exObjListAtom
Constructors Summary
protected ExObjList(byte[] source, int start, int len)
Set things up, and find our more interesting children

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

		// Find our children
		_children = Record.findChildRecords(source,start+8,len-8);
		findInterestingChildren();
	
public ExObjList()
Create a new ExObjList, with blank fields

		_header = new byte[8];
		_children = new Record[1];
		
		// Setup our header block
		_header[0] = 0x0f; // We are a container record
		LittleEndian.putShort(_header, 2, (short)_type);
		
		// Setup our child records
		_children[0] = new ExObjListAtom();
		findInterestingChildren();
	
Methods Summary
private voidfindInterestingChildren()
Go through our child records, picking out the ones that are interesting, and saving those for use by the easy helper methods.

		// First child should be the atom
		if(_children[0] instanceof ExObjListAtom) {
			exObjListAtom = (ExObjListAtom)_children[0];
		} else {
			throw new IllegalStateException("First child record wasn't a ExObjListAtom, was of type " + _children[0].getRecordType());
		}
	
public org.apache.poi.hslf.record.ExHyperlinkget(int id)
Lookup a hyperlink by its unique id

param
id hyperlink id
return
found ExHyperlink or null

        for(int i=0; i<_children.length; i++) {
            if(_children[i] instanceof ExHyperlink) {
                ExHyperlink rec = (ExHyperlink)_children[i];
                if (rec.getExHyperlinkAtom().getNumber() == id){
                    return rec;
                }
            }
        }
        return null;
    
public org.apache.poi.hslf.record.ExHyperlink[]getExHyperlinks()
Returns all the ExHyperlinks

		ArrayList links = new ArrayList();
		for(int i=0; i<_children.length; i++) {
			if(_children[i] instanceof ExHyperlink) {
				links.add(_children[i]);
			}
		}

		return (ExHyperlink[])links.toArray(new ExHyperlink[links.size()]);
	
public org.apache.poi.hslf.record.ExObjListAtomgetExObjListAtom()
Returns the ExObjListAtom of this list

 
	
	       	  
	    return exObjListAtom; 
public longgetRecordType()
We are of type 1033

 return _type; 
public voidwriteOut(java.io.OutputStream out)
Write the contents of the record back, so it can be written to disk

		writeOut(_header[0],_header[1],_type,_children,out);