FileDocCategorySizeDatePackage
PointerFactory.javaAPI DocApache Poi 3.0.11890Tue Jun 19 19:31:04 BST 2007org.apache.poi.hdgf.pointers

PointerFactory

public class PointerFactory extends Object
Factor class to create the appropriate pointers, based on the version of the file

Fields Summary
private int
version
Constructors Summary
public PointerFactory(int version)

		this.version = version;
	
Methods Summary
public org.apache.poi.hdgf.pointers.PointercreatePointer(byte[] data, int offset)

		Pointer p;
		if(version >= 6) {
			p = new PointerV6();
			p.type = LittleEndian.getInt(data, offset+0);
			p.address = (int)LittleEndian.getUInt(data, offset+4);
			p.offset = (int)LittleEndian.getUInt(data, offset+8);
			p.length = (int)LittleEndian.getUInt(data, offset+12);
			p.format = LittleEndian.getShort(data, offset+16);
			
			return p;
		} else if(version == 5) {
			throw new RuntimeException("TODO");
		} else {
			throw new IllegalArgumentException("Visio files with versions below 5 are not supported, yours was " + version);
		}
	
public intgetVersion()

 return version;