FileDocCategorySizeDatePackage
SpecialPropertySet.javaAPI DocApache Poi 3.0.18354Mon Jan 01 12:39:34 GMT 2007org.apache.poi.hpsf

SpecialPropertySet

public abstract class SpecialPropertySet extends MutablePropertySet

Abstract superclass for the convenience classes {@link SummaryInformation} and {@link DocumentSummaryInformation}.

The motivation behind this class is quite nasty if you look behind the scenes, but it serves the application programmer well by providing him with the easy-to-use {@link SummaryInformation} and {@link DocumentSummaryInformation} classes. When parsing the data a property set stream consists of (possibly coming from an {@link java.io.InputStream}) we want to read and process each byte only once. Since we don't know in advance which kind of property set we have, we can expect only the most general {@link PropertySet}. Creating a special subclass should be as easy as calling the special subclass' constructor and pass the general {@link PropertySet} in. To make things easy internally, the special class just holds a reference to the general {@link PropertySet} and delegates all method calls to it.

A cleaner implementation would have been like this: The {@link PropertySetFactory} parses the stream data into some internal object first. Then it finds out whether the stream is a {@link SummaryInformation}, a {@link DocumentSummaryInformation} or a general {@link PropertySet}. However, the current implementation went the other way round historically: the convenience classes came only late to my mind.

author
Rainer Klute <klute@rainer-klute.de>
version
$Id: SpecialPropertySet.java 489730 2006-12-22 19:18:16Z bayard $
since
2002-02-09

Fields Summary
private MutablePropertySet
delegate

The "real" property set SpecialPropertySet delegates to.

Constructors Summary
public SpecialPropertySet(PropertySet ps)

Creates a SpecialPropertySet.

param
ps The property set to be encapsulated by the SpecialPropertySet

        delegate = new MutablePropertySet(ps);
    
public SpecialPropertySet(MutablePropertySet ps)

Creates a SpecialPropertySet.

param
ps The mutable property set to be encapsulated by the SpecialPropertySet

        delegate = ps;
    
Methods Summary
public voidaddSection(org.apache.poi.hpsf.Section section)

see
org.apache.poi.hpsf.MutablePropertySet#addSection(org.apache.poi.hpsf.Section)

        delegate.addSection(section);
    
public voidclearSections()

see
org.apache.poi.hpsf.MutablePropertySet#clearSections()

        delegate.clearSections();
    
public booleanequals(java.lang.Object o)

see
org.apache.poi.hpsf.PropertySet#equals(java.lang.Object)

        return delegate.equals(o);
    
public intgetByteOrder()

see
PropertySet#getByteOrder

        return delegate.getByteOrder();
    
public org.apache.poi.hpsf.ClassIDgetClassID()

see
PropertySet#getClassID

        return delegate.getClassID();
    
public org.apache.poi.hpsf.SectiongetFirstSection()

see
PropertySet#getSingleSection

        return delegate.getFirstSection();
    
public intgetFormat()

see
PropertySet#getFormat

        return delegate.getFormat();
    
public intgetOSVersion()

see
PropertySet#getOSVersion

        return delegate.getOSVersion();
    
public org.apache.poi.hpsf.Property[]getProperties()

see
org.apache.poi.hpsf.PropertySet#getProperties()

        return delegate.getProperties();
    
protected java.lang.ObjectgetProperty(int id)

see
org.apache.poi.hpsf.PropertySet#getProperty(int)

        return delegate.getProperty(id);
    
protected booleangetPropertyBooleanValue(int id)

see
org.apache.poi.hpsf.PropertySet#getPropertyBooleanValue(int)

        return delegate.getPropertyBooleanValue(id);
    
protected intgetPropertyIntValue(int id)

see
org.apache.poi.hpsf.PropertySet#getPropertyIntValue(int)

        return delegate.getPropertyIntValue(id);
    
public intgetSectionCount()

see
PropertySet#getSectionCount

        return delegate.getSectionCount();
    
public java.util.ListgetSections()

see
PropertySet#getSections

        return delegate.getSections();
    
public inthashCode()

see
org.apache.poi.hpsf.PropertySet#hashCode()

        return delegate.hashCode();
    
public booleanisDocumentSummaryInformation()

see
PropertySet#isDocumentSummaryInformation

        return delegate.isDocumentSummaryInformation();
    
public booleanisSummaryInformation()

see
PropertySet#isSummaryInformation

        return delegate.isSummaryInformation();
    
public voidsetByteOrder(int byteOrder)

see
org.apache.poi.hpsf.MutablePropertySet#setByteOrder(int)

        delegate.setByteOrder(byteOrder);
    
public voidsetClassID(org.apache.poi.hpsf.ClassID classID)

see
org.apache.poi.hpsf.MutablePropertySet#setClassID(org.apache.poi.hpsf.ClassID)

        delegate.setClassID(classID);
    
public voidsetFormat(int format)

see
org.apache.poi.hpsf.MutablePropertySet#setFormat(int)

        delegate.setFormat(format);
    
public voidsetOSVersion(int osVersion)

see
org.apache.poi.hpsf.MutablePropertySet#setOSVersion(int)

        delegate.setOSVersion(osVersion);
    
public java.io.InputStreamtoInputStream()

see
org.apache.poi.hpsf.MutablePropertySet#toInputStream()

        return delegate.toInputStream();
    
public java.lang.StringtoString()

see
org.apache.poi.hpsf.PropertySet#toString()

        return delegate.toString();
    
public booleanwasNull()

see
org.apache.poi.hpsf.PropertySet#wasNull()

        return delegate.wasNull();
    
public voidwrite(org.apache.poi.poifs.filesystem.DirectoryEntry dir, java.lang.String name)

see
org.apache.poi.hpsf.MutablePropertySet#write(org.apache.poi.poifs.filesystem.DirectoryEntry, java.lang.String)

        delegate.write(dir, name);
    
public voidwrite(java.io.OutputStream out)

see
org.apache.poi.hpsf.MutablePropertySet#write(java.io.OutputStream)

        delegate.write(out);