FileDocCategorySizeDatePackage
CustomProperty.javaAPI DocApache Poi 3.0.13762Mon Jan 01 12:39:34 GMT 2007org.apache.poi.hpsf

CustomProperty

public class CustomProperty extends MutableProperty

This class represents custum 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.

author
Rainer Klute <klute@rainer-klute.de>
since
2006-02-09
version
$Id$

Fields Summary
private String
name
Constructors Summary
public CustomProperty()

Creates an empty {@link CustomProperty}. The set methods must be called to make it usable.

        this.name = null;
    
public CustomProperty(Property property)

Creates a {@link CustomProperty} without a name by copying the underlying {@link Property}' attributes.

param
property the property to copy

        this(property, null);
    
public CustomProperty(Property property, String name)

Creates a {@link CustomProperty} with a name.

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

        super(property);
        this.name = name;
    
Methods Summary
public booleanequalsContents(java.lang.Object o)

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

param
o The custom property to compare with.
return
true if both custom properties are equal, else false.
see
java.util.AbstractSet#equals(java.lang.Object)

        final CustomProperty c = (CustomProperty) o;
        final String name1 = c.getName();
        final String name2 = this.getName();
        boolean equalNames = true;
        if (name1 == null)
            equalNames = name2 == null;
        else
            equalNames = name1.equals(name2);
        return equalNames && c.getID() == this.getID()
                && c.getType() == this.getType()
                && c.getValue().equals(this.getValue());
    
public java.lang.StringgetName()

Gets the property's name.

return
the property's name.

        return name;
    
public inthashCode()

see
java.util.AbstractSet#hashCode()

        return (int) this.getID();
    
public voidsetName(java.lang.String name)

Sets the property's name.

param
name The name to set.

        this.name = name;