DocumentPropertyCollection

Inheritance: java.lang.Object, com.aspose.cells.CollectionBase

public abstract class DocumentPropertyCollection extends CollectionBase

Base class for BuiltInDocumentPropertyCollection and CustomDocumentPropertyCollection collections.

Example

         //Instantiate a Workbook object by calling its empty constructor
         Workbook workbook = new Workbook("book1.xls");
 
         //Retrieve a list of all custom document properties of the Excel file
         DocumentPropertyCollection customProperties = workbook.getWorksheets().getCustomDocumentProperties();
 
         //Accessng a custom document property by using the property index
         DocumentProperty customProperty1 = customProperties.get(3);
 
         //Accessng a custom document property by using the property name
         DocumentProperty customProperty2 = customProperties.get("Owner");

Methods

MethodDescription
add(Object o)Adds an item to the CollectionBase instance.
clear()Removes all objects from the CollectionBase instance.
contains(Object o)Return whether instance contains this object
contains(String name)Returns true if a property with the specified name exists in the collection.
equals(Object arg0)
get(int index)Returns a DocumentProperty object by index.
get(String name)Returns a DocumentProperty object by the name of the property.
getClass()
getCount()Gets the number of elements contained in the CollectionBase instance.
hashCode()
indexOf(Object o)Determines the index of a specific item in the CollectionBase instance.
indexOf(String name)Gets the index of a property by name.
iterator()Returns an enumerator that iterates through the CollectionBase instance.
notify()
notifyAll()
remove(String name)Removes a property with the specified name from the collection.
removeAt(int index)Removes a property at the specified index.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

add(Object o)

public int add(Object o)

Adds an item to the CollectionBase instance.

Parameters:

ParameterTypeDescription
ojava.lang.ObjectThe Object to add to the CollectionBase instance.

Returns: int - The position into which the new element was inserted.

clear()

public void clear()

Removes all objects from the CollectionBase instance.

contains(Object o)

public boolean contains(Object o)

Return whether instance contains this object

Parameters:

ParameterTypeDescription
ojava.lang.Objecttest object

Returns: boolean - Whether instance contains this object

contains(String name)

public boolean contains(String name)

Returns true if a property with the specified name exists in the collection.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe case-insensitive name of the property.

Returns: boolean - True if the property exists in the collection; false otherwise.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

get(int index)

public DocumentProperty get(int index)

Returns a DocumentProperty object by index.

Parameters:

ParameterTypeDescription
indexintZero-based index of the DocumentProperty to retrieve.

Returns: DocumentProperty

get(String name)

public DocumentProperty get(String name)

Returns a DocumentProperty object by the name of the property.

Remarks

Returns null if a property with the specified name is not found.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe case-insensitive name of the property to retrieve.

Returns: DocumentProperty

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCount()

public int getCount()

Gets the number of elements contained in the CollectionBase instance.

Returns: int - The number of elements contained in the CollectionBase instance.

hashCode()

public native int hashCode()

Returns: int

indexOf(Object o)

public int indexOf(Object o)

Determines the index of a specific item in the CollectionBase instance.

Parameters:

ParameterTypeDescription
ojava.lang.ObjectDetermines the index of a specific item in the CollectionBase instance.

Returns: int - The index of value if found in the list; otherwise, -1.

indexOf(String name)

public int indexOf(String name)

Gets the index of a property by name.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe case-insensitive name of the property.

Returns: int - The zero based index. Negative value if not found.

iterator()

public Iterator iterator()

Returns an enumerator that iterates through the CollectionBase instance.

Returns: java.util.Iterator - An iterator for the CollectionBase instance.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

remove(String name)

public void remove(String name)

Removes a property with the specified name from the collection.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe case-insensitive name of the property.

removeAt(int index)

public void removeAt(int index)

Removes a property at the specified index.

Parameters:

ParameterTypeDescription
indexintThe zero based index.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int