| java.lang.Object org.apache.poi.hpsf.Section org.apache.poi.hpsf.MutableSection
MutableSection | public class MutableSection extends Section (Code) | | Adds writing capability to the
Section class.
Please be aware that this class' functionality will be merged into the
Section class at a later time, so the API will change.
version: $Id: MutableSection.java 489730 2006-12-22 19:18:16Z bayard $ since: 2002-02-20 |
MutableSection | public MutableSection()(Code) | | Creates an empty mutable section.
|
MutableSection | public MutableSection(Section s)(Code) | | Constructs a MutableSection by doing a deep copy of an
existing Section . All nested Property
instances, will be their mutable counterparts in the new
MutableSection .
Parameters: s - The section set to copy |
clear | public void clear()(Code) | | Removes all properties from the section including 0 (dictionary) and
1 (codepage).
|
getProperties | public Property[] getProperties()(Code) | | Gets this section's properties.
this section's properties. |
getProperty | public Object getProperty(long id)(Code) | | Gets a property.
Parameters: id - The ID of the property to get The property or null if there is no such property |
getPropertyCount | public int getPropertyCount()(Code) | | Overwrites the super class' method to cope with a redundancy:
the property count is maintained in a separate member variable, but
shouldn't.
The number of properties in this section |
getSize | public int getSize()(Code) | | Returns the section's size.
the section's size. |
removeProperty | public void removeProperty(long id)(Code) | | Removes a property.
Parameters: id - The ID of the property to be removed |
setCodepage | public void setCodepage(int codepage)(Code) | | Sets the codepage.
Parameters: codepage - the codepage |
setDictionary | public void setDictionary(Map dictionary) throws IllegalPropertySetDataException(Code) | | Sets the section's dictionary. All keys in the dictionary must be
java.lang.Long instances, all values must be
java.lang.String s. This method overwrites the properties with IDs
0 and 1 since they are reserved for the dictionary and the dictionary's
codepage. Setting these properties explicitly might have surprising
effects. An application should never do this but always use this
method.
Parameters: dictionary - The dictionary exception: IllegalPropertySetDataException - if the dictionary's key andvalue types are not correct. See Also: Section.getDictionary |
setProperties | public void setProperties(Property[] properties)(Code) | | Sets this section's properties. Any former values are overwritten.
Parameters: properties - This section's new properties. |
setProperty | public void setProperty(int id, long variantType, Object value)(Code) | | Sets the value and the variant type of the property with the
specified ID. If a property with this ID is not yet present in
the section, it will be added. An already present property with
the specified ID will be overwritten. A default mapping will be
used to choose the property's type.
Parameters: id - The property's ID. Parameters: variantType - The property's variant type. Parameters: value - The property's value. See Also: MutableSection.setProperty(int,String) See Also: MutableSection.getProperty See Also: Variant |
setProperty | public void setProperty(int id, Object value)(Code) | | Sets a property.
Parameters: id - The property ID. Parameters: value - The property's value. The value's class must be one of thosesupported by HPSF. |
write | public int write(OutputStream out) throws WritingNotSupportedException, IOException(Code) | | Writes this section into an output stream.
Internally this is done by writing into three byte array output
streams: one for the properties, one for the property list and one for
the section as such. The two former are appended to the latter when they
have received all their data.
Parameters: out - The stream to write into. The number of bytes written, i.e. the section's size. exception: IOException - if an I/O error occurs exception: WritingNotSupportedException - if HPSF does not yet supportwriting a property's variant type. |
|
|