|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hpsf.Section
public class Section
Represents a section in a PropertySet
.
Constructor Summary | |
---|---|
Section(byte[] src,
int offset)
Creates a Section instance from a byte array. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Checks whether this section is equal to another object. |
int |
getCodepage()
Gets the section's codepage, if any. |
java.util.Map |
getDictionary()
Gets the section's dictionary. |
ClassID |
getFormatID()
Returns the format ID. |
long |
getOffset()
Returns the offset of the section in the stream. |
java.lang.String |
getPIDString(long pid)
Returns the PID string associated with a property ID. |
Property[] |
getProperties()
Returns this section's properties. |
java.lang.Object |
getProperty(long id)
Returns the value of the property with the specified ID. |
int |
getPropertyCount()
Returns the number of properties in this section. |
int |
getSize()
Returns the section's size in bytes. |
int |
hashCode()
|
java.lang.String |
toString()
|
boolean |
wasNull()
Checks whether the property which the last call to getPropertyIntValue(long) or getProperty(long) tried to access
was available or not. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Section(byte[] src, int offset) throws java.io.UnsupportedEncodingException
Creates a Section
instance from a byte array.
src
- Contains the complete property set stream.offset
- The position in the stream that points to the
section's format ID.
java.io.UnsupportedEncodingException
- if the section's codepage is not
supported.Method Detail |
---|
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 Section
contains the bytes specified by
org.apache.poi.hpsf.wellknown.SectionIDMap.SUMMARY_INFORMATION_ID
the section (and thus the property set) is a SummaryInformation.
public long getOffset()
Returns the offset of the section in the stream.
public int getSize()
Returns the section's size in bytes.
public int getPropertyCount()
Returns the number of properties in this section.
public Property[] getProperties()
Returns this section's properties.
public java.lang.Object getProperty(long id)
Returns the value of the property with the specified ID. If
the property is not available, null
is returned
and a subsequent call to wasNull
will return
true
.
id
- The property's ID
public boolean wasNull()
Checks whether the property which the last call to getPropertyIntValue(long)
or getProperty(long)
tried to access
was available or not. This information might be important for
callers of getPropertyIntValue(long)
since the latter
returns 0 if the property does not exist. Using wasNull
the caller can distiguish this case from a property's
real value of 0.
true
if the last call to getPropertyIntValue(long)
or getProperty(long)
tried to access a
property that was not available, else false
.public java.lang.String getPIDString(long pid)
Returns the PID string associated with a property ID. The ID
is first looked up in the Section
's private
dictionary. If it is not found there, the method calls SectionIDMap.getPIDString(byte[], long)
.
pid
- The property ID
public boolean equals(java.lang.Object o)
Checks whether this section is equal to another object. The result is
false
if one of the the following conditions holds:
The other object is not a Section
.
The format IDs of the two sections are not equal.
The sections have a different number of properties. However, properties with ID 1 (codepage) are not counted.
The other object is not a Section
.
The properties have different values. The order of the properties is irrelevant.
equals
in class java.lang.Object
o
- The object to compare this section with
true
if the objects are equal, false
if
notpublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.util.Map getDictionary()
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.
null
if the section does not have
a dictionary.public int getCodepage()
Gets the section's codepage, if any.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |