org.apache.poi.hpsf
Class CustomProperty

java.lang.Object
  extended by org.apache.poi.hpsf.Property
      extended by org.apache.poi.hpsf.MutableProperty
          extended by org.apache.poi.hpsf.CustomProperty

public class CustomProperty
extends MutableProperty

This class represents custom properties in the document summary information stream. The difference to normal properties is that custom properties have an optional name. If the name is not null it will be maintained in the section's dictionary.


Field Summary
 
Fields inherited from class org.apache.poi.hpsf.Property
DEFAULT_CODEPAGE
 
Constructor Summary
CustomProperty()
          Creates an empty CustomProperty.
CustomProperty(Property property)
          Creates a CustomProperty without a name by copying the underlying Property' attributes.
CustomProperty(Property property, java.lang.String name)
          Creates a CustomProperty with a name.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares two properties.
 boolean equalsContents(java.lang.Object o)
          Compares two custom properties for equality.
 java.lang.String getName()
          Gets the property's name.
 int hashCode()
           
 void setName(java.lang.String name)
          Sets the property's name.
 
Methods inherited from class org.apache.poi.hpsf.Property
getID, getSize, getType, getValue, setID, setType, setValue, toString, toString, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomProperty

public CustomProperty()
Creates an empty CustomProperty. The set methods must be called to make it usable.


CustomProperty

public CustomProperty(Property property)
Creates a CustomProperty without a name by copying the underlying Property' attributes.

Parameters:
property - the property to copy

CustomProperty

public CustomProperty(Property property,
                      java.lang.String name)
Creates a CustomProperty with a name.

Parameters:
property - This property's attributes are copied to the new custom property.
name - The new custom property's name.
Method Detail

getName

public java.lang.String getName()
Gets the property's name.

Returns:
the property's name.

setName

public void setName(java.lang.String name)
Sets the property's name.

Parameters:
name - The name to set.

equalsContents

public boolean equalsContents(java.lang.Object o)
Compares two custom properties for equality. The method returns true if all attributes of the two custom properties are equal.

Parameters:
o - The custom property to compare with.
Returns:
true if both custom properties are equal, else false.
See Also:
AbstractSet.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Property
See Also:
AbstractSet.hashCode()

equals

public boolean equals(java.lang.Object o)
Description copied from class: Property
Compares two properties.

Please beware that a property with ID == 0 is a special case: It does not have a type, and its value is the section's dictionary. Another special case are strings: Two properties may have the different types Variant.VT_LPSTR and Variant.VT_LPWSTR;

Overrides:
equals in class Property
See Also:
Object.equals(java.lang.Object)