Top Description Fields Constructors Methods
org.apache.poi.hpsf

public Class CustomProperty

extends Property
Class Inheritance
Imports
java.util.Objects

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

Modifier and TypeField and Description
private String
Inherited from org.apache.poi.hpsf.Property:
DEFAULT_CODEPAGE

Constructor Summary

AccessConstructor and Description
public
CustomProperty()

Creates an empty CustomProperty.

public
CustomProperty(final Property
the property to copy
property
)

Creates a CustomProperty without a name by copying the underlying Property' attributes.

public
CustomProperty(final Property
This property's attributes are copied to the new custom property.
property
,
final String
The new custom property's name.
name
)

Creates a CustomProperty with a name.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides org.apache.poi.hpsf.Property.equals.

Compares two properties.

public boolean

Returns:

true if both custom properties are equal, else false.
equalsContents
(final Object
The custom property to compare with.
o
)

Compares two custom properties for equality.

public String

Returns:

the property's name.
getName
()

Gets the property's name.

public int
hashCode()

Overrides org.apache.poi.hpsf.Property.hashCode.

Returns a hash code value for this object.

public void
setName(final String
The name to set.
name
)

Sets the property's name.

Inherited from org.apache.poi.hpsf.Property:
getIDgetSizegetTypegetValuesetIDsetTypesetValuetoStringtoStringwrite

Field Detail

nameback to summary
private String name

Constructor Detail

CustomPropertyback to summary
public CustomProperty()

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

CustomPropertyback to summary
public CustomProperty(final Property property)

Creates a CustomProperty without a name by copying the underlying Property' attributes.

Parameters
property:Property

the property to copy

CustomPropertyback to summary
public CustomProperty(final Property property, final String name)

Creates a CustomProperty with a name.

Parameters
property:Property

This property's attributes are copied to the new custom property.

name:String

The new custom property's name.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides org.apache.poi.hpsf.Property.equals.

Doc from org.apache.poi.hpsf.Property.equals.

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;

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
equalsContentsback to summary
public boolean equalsContents(final Object o)

Compares two custom properties for equality. The method returns true if all attributes of the two custom properties are equal.

Parameters
o:Object

The custom property to compare with.

Returns:boolean

true if both custom properties are equal, else false.

See Also
java.util.AbstractSet#equals(java.lang.Object)
getNameback to summary
public String getName()

Gets the property's name.

Returns:String

the property's name.

hashCodeback to summary
public int hashCode()

Overrides org.apache.poi.hpsf.Property.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
See Also
java.util.AbstractSet#hashCode()
setNameback to summary
public void setName(final String name)

Sets the property's name.

Parameters
name:String

The name to set.