public class CustomProperty extends Property
null
it will be maintained in the section's dictionary.
(此类表示文档摘要信息流中的自定义属性。与普通属性的区别在于自定义属性具有可选名称。如果名称不为空,它将保留在该部分的字典中。)
DEFAULT_CODEPAGE
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
(设置属性的名称。)
|
public CustomProperty()
CustomProperty
. The set methods must be called to make it usable.
(创建一个空的 CustomProperty。必须调用 set 方法才能使其可用。)
public CustomProperty(Property property)
CustomProperty
without a name by copying the underlying
Property
' attributes.
(通过复制基础属性的属性来创建没有名称的 CustomProperty。)
property
- the property to copy
(property - 要复制的属性)
public CustomProperty(Property property, java.lang.String name)
CustomProperty
with a name.
(创建一个带有名称的 CustomProperty。)
property
- This property's attributes are copied to the new custom property.
(property - 此属性的属性被复制到新的自定义属性。)
name
- The new custom property's name.
(name - 新自定义属性的名称。)
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name to set.
(name - 要设置的名称。)
public boolean equalsContents(java.lang.Object o)
true
if all attributes of the two custom properties are equal.
(比较两个自定义属性是否相等。如果两个自定义属性的所有属性都相等,则该方法返回 true。)
o
- The custom property to compare with.
(o - 要与之比较的自定义属性。)
true
if both custom properties are equal, else
false
.
(如果两个自定义属性相等,则为 true,否则为 false。)
AbstractSet.equals(java.lang.Object)
public int hashCode()
public boolean equals(java.lang.Object o)
Property
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;
(比较两个属性。请注意 ID == 0 的属性是一种特殊情况:它没有类型,其值是该部分的字典。另一种特殊情况是字符串:两个属性可能具有不同的类型 Variant.VT_LPSTR 和 Variant.VT_LPWSTR;)Copyright 2021 The Apache Software Foundation or its licensors, as applicable.