|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hpsf.Section
Represents a section in a PropertySet
.
Field Summary | |
protected java.util.Map |
dictionary
Maps property IDs to section-private PID strings. |
protected ClassID |
formatID
|
protected long |
offset
|
protected Property[] |
properties
|
protected int |
propertyCount
|
protected int |
size
|
Constructor Summary | |
protected |
Section()
Creates an empty and uninitialized Section . |
|
Section(byte[] src,
int offset)
Creates a Section instance from a byte array. |
Method Summary | |
ClassID |
getFormatID()
Returns the format ID. |
long |
getOffset()
Returns the offset of the section in the stream. |
java.lang.String |
getPIDString(int pid)
Returns the PID string associated with a property ID. |
Property[] |
getProperties()
Returns this section's properties. |
java.lang.Object |
getProperty(int id)
Returns the value of the property with the specified ID. |
protected boolean |
getPropertyBooleanValue(int id)
Returns the value of the boolean property with the specified ID. |
int |
getPropertyCount()
Returns the number of properties in this section. |
protected int |
getPropertyIntValue(int id)
Returns the value of the numeric property with the specified ID. |
int |
getSize()
Returns the section's size in bytes. |
boolean |
wasNull()
Checks whether the property which the last call to getPropertyIntValue(int) or getProperty(int) tried to access
was available or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map dictionary
Maps property IDs to section-private PID strings. These strings can be found in the property with ID 0.
protected ClassID formatID
protected long offset
protected int size
protected int propertyCount
protected Property[] properties
Constructor Detail |
protected Section()
Creates an empty and uninitialized Section
.
public Section(byte[] src, int offset)
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.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(int 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
protected int getPropertyIntValue(int 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 wasNull()
will return
true
to let the caller distinguish that case from
a real property value of 0.
id
- The property's ID
protected boolean getPropertyBooleanValue(int id)
Returns the value of the boolean property with the specified
ID. If the property is not available, false
is
returned. A subsequent call to wasNull()
will return
true
to let the caller distinguish that case from
a real property value of false
.
id
- The property's ID
public boolean wasNull()
Checks whether the property which the last call to getPropertyIntValue(int)
or getProperty(int)
tried to access
was available or not. This information might be important for
callers of getPropertyIntValue(int)
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(int)
or getProperty(int)
tried to access a
property that was not available, else false
.public java.lang.String getPIDString(int 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[], int)
.
pid
- The property ID
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |