PropertySet.
| Modifier and Type | Field and Description |
|---|---|
| private final long | _offset
The offset of the section in the stream. |
| private Map | dictionary
Maps property IDs to section-private PID strings. |
| private ClassID | formatID
The section's format ID, |
| private static final Logger | |
| private final Map | properties
This section's properties. |
| private final UnsynchronizedByteArrayOutputStream | sectionBytes
Contains the bytes making out the section. |
| private transient boolean | wasNull
This member is |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Section(final byte[]
Contains the complete property set stream. src, final int The position in the stream that points to the
section's format ID. offset)Creates a Section instance from a byte array. |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| public void | |
| public boolean | Returns: true if the objects are equal, false if
notThe object to compare this section with o)Overrides java. Checks whether this section is equal to another object. |
| public int | Returns: The section's codepage if one is defined, else -1.Gets the section's codepage, if any. |
| public Map | Returns: the dictionary ornull if the section does not have
a dictionary.Gets the section's dictionary. |
| public ClassID | Returns: The format IDReturns the format ID. The format ID is the "type" of the section. |
| public long | Returns: The offset of the section in the stream.Returns the offset of the section in the stream. |
| public String | Returns: The well-known property ID string associated with the property IDpidThe property ID pid)Returns the PID string associated with a property ID. The ID is first looked up in the Sections private dictionary. |
| public Property[] | |
| public Object | Returns: The property's valueThe property's ID id)Returns the value of the property with the specified ID. If
the property is not available, |
| pack-priv boolean | Returns: The property's valueThe property's ID id)Returns the value of the boolean property with the specified
ID. If the property is not available, |
| public int | Returns: The number of properties in this section.Returns the number of properties in this section. |
| pack-priv int | Returns: The property's valueThe property's ID id)Returns the value of the numeric property with the specified ID. If the property is not available, 0 is returned. |
| public int | |
| public int | |
| private void | |
| private static int | Returns: the length of the current propertythe offset to id map offset2Id, Long the current entry key entryOffset, long the maximum offset/size of the section stream maxSize)Retrieves the length of the given property (by key) |
| private boolean | Returns: true if dictionary was read successful, false otherwiseThe byte stream containing the bytes making out the dictionary. leis, final int The dictionary contains at most this many bytes. length, final int The codepage of the string values. codepage)Reads a dictionary. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setFormatID(final byte[]
The section's format ID as a byte array. It components
are in big-endian format. formatID)Sets the section's format ID. |
| public void | setProperties(final Property[]
This section's new properties. properties)Sets this section's properties. |
| public void | setProperty(final int
The property's ID id, final String The property's value. value)Sets the string value of the property with the specified ID. |
| public void | setProperty(final int
The property's ID id, final int The property's value. value)Sets the int value of the property with the specified ID. |
| public void | setProperty(final int
The property's ID id, final long The property's value. value)Sets the long value of the property with the specified ID. |
| public void | setProperty(final int
The property's ID id, final boolean The property's value. value)Sets the boolean value of the property with the specified ID. |
| public void | setProperty(final int
The property's ID. id, final long The property's variant type. variantType, final Object The property's value. value)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. |
| public void | |
| public void | setProperty(final int
The property ID. id, final Object The property's value. The value's class must be one of those
supported by HPSF. value)Sets a property. |
| protected void | setPropertyBooleanValue(final int
The property's ID id, final boolean The property's value value)Sets the value of the boolean property with the specified ID. |
| public String | |
| public String | |
| public boolean | Returns: true if the last call to getPropertyIntValue or getProperty tried to access a
property that was not available, else false.Checks whether the property which the last call to |
| public int | Returns: The number of bytes written, i.e. the section's size.The stream to write into. out)Writes this section into an output stream. |
| private void | writeDictionary(final OutputStream
The output stream to write to. out, final int The codepage to be used to write the dictionary items. codepage)Writes the section's dictionary. |
| _offset | back to summary |
|---|---|
| private final long _offset The offset of the section in the stream. | |
| dictionary | back to summary |
|---|---|
| private Map<Long, String> dictionary Maps property IDs to section-private PID strings. These strings can be found in the property with ID 0. | |
| formatID | back to summary |
|---|---|
| private ClassID formatID The section's format ID, | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| properties | back to summary |
|---|---|
| private final Map<Long, Property> properties This section's properties. | |
| sectionBytes | back to summary |
|---|---|
| private final UnsynchronizedByteArrayOutputStream sectionBytes Contains the bytes making out the section. This byte array is established when the section's size is calculated and can be reused later. If the array is empty, the section was modified and the bytes need to be regenerated. | |
| wasNull | back to summary |
|---|---|
| private transient boolean wasNull This member is | |
| Section | back to summary |
|---|---|
| public Section() Creates an empty Section. | |
| Section | back to summary |
|---|---|
| public Section(final Section s) Constructs a
| |
| Section | back to summary |
|---|---|
| public Section(final byte[] src, final int offset) throws UnsupportedEncodingException Creates a Section instance from a byte array.
| |
| calcSize | back to summary |
|---|---|
| private int calcSize() throws WritingNotSupportedException, IOException Calculates the section's size. It is the sum of the lengths of the section's header (8), the properties list (16 times the number of properties) and the properties themselves.
| |
| clear | back to summary |
|---|---|
| public void clear() Removes all properties from the section including 0 (dictionary) and 1 (codepage). | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Checks whether this section is equal to another object. The result is
| |
| getCodepage | back to summary |
|---|---|
| public int getCodepage() Gets the section's codepage, if any.
| |
| getDictionary | back to summary |
|---|---|
| public Map Gets the section's dictionary. A dictionary allows an application to use human-readable property names instead of numeric property IDs. It contains mappings from property IDs to their associated string values. The dictionary is stored as the property with ID 0. The codepage for the strings in the dictionary is defined by property with ID 1.
| |
| getFormatID | back to summary |
|---|---|
| public ClassID getFormatID() Returns the format ID. The format ID is the "type" of the
section. For example, if the format ID of the first
| |
| getOffset | back to summary |
|---|---|
| public long getOffset() Returns the offset of the section in the stream.
| |
| getPIDString | back to summary |
|---|---|
| public String getPIDString(final long pid) Returns the PID string associated with a property ID. The ID
is first looked up in the Sections private dictionary.
If it is not found there, the property PID string is taken
from sections format IDs namespace.
If the PID is also undefined there, i.e. it is not well-known,
| |
| getProperties | back to summary |
|---|---|
| public Property[] getProperties() Returns this section's properties.
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(final long id) Returns the value of the property with the specified ID. If
the property is not available,
| |
| getPropertyBooleanValue | back to summary |
|---|---|
| pack-priv boolean getPropertyBooleanValue(final int id) Returns the value of the boolean property with the specified
ID. If the property is not available,
| |
| getPropertyCount | back to summary |
|---|---|
| public int getPropertyCount() Returns the number of properties in this section.
| |
| getPropertyIntValue | back to summary |
|---|---|
| pack-priv int getPropertyIntValue(final long id) Returns the value of the numeric property with the specified
ID. If the property is not available, 0 is returned. A
subsequent call to
| |
| getSize | back to summary |
|---|---|
public int getSize()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| padSectionBytes | back to summary |
|---|---|
| private void padSectionBytes() | |
| propLen | back to summary |
|---|---|
| private static int propLen(TreeBidiMap<Long, Long> offset2Id, Long entryOffset, long maxSize) Retrieves the length of the given property (by key)
| |
| readDictionary | back to summary |
|---|---|
| private boolean readDictionary(LittleEndianByteArrayInputStream leis, final int length, final int codepage) Reads a dictionary.
| |
| removeProperty | back to summary |
|---|---|
| public void removeProperty(final long id) Removes a property.
| |
| setCodepage | back to summary |
|---|---|
| public void setCodepage(final int codepage) Sets the codepage.
| |
| setDictionary | back to summary |
|---|---|
| public void setDictionary(final Map<Long, String> dictionary) throws IllegalPropertySetDataException Sets the section's dictionary. All keys in the dictionary must be
| |
| setFormatID | back to summary |
|---|---|
| public void setFormatID(final ClassID formatID) Sets the section's format ID.
| |
| setFormatID | back to summary |
|---|---|
| public void setFormatID(final byte[] formatID) Sets the section's format ID.
| |
| setProperties | back to summary |
|---|---|
| public void setProperties(final Property[] properties) Sets this section's properties. Any former values are overwritten.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final int id, final String value) Sets the string value of the property with the specified ID.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final int id, final int value) Sets the int value of the property with the specified ID.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final int id, final long value) Sets the long value of the property with the specified ID.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final int id, final boolean value) Sets the boolean value of the property with the specified ID.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final int id, final long variantType, final Object value) 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.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final Property p) Sets a property.
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(final int id, final Object value) Sets a property.
| |
| setPropertyBooleanValue | back to summary |
|---|---|
| protected void setPropertyBooleanValue(final int id, final boolean value) Sets the value of the boolean property with the specified ID.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toString | back to summary |
|---|---|
| public String toString(PropertyIDMap idMap) | |
| wasNull | back to summary |
|---|---|
| public boolean wasNull() Checks whether the property which the last call to
| |
| write | back to summary |
|---|---|
| public int write(final OutputStream out) throws WritingNotSupportedException, IOException 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.
| |
| writeDictionary | back to summary |
|---|---|
| private void writeDictionary(final OutputStream out, final int codepage) throws IOException Writes the section's dictionary.
| |