com.aspose.words
Class FieldCollection

java.lang.Object
    extended by com.aspose.words.FieldCollection
All Implemented Interfaces:
java.lang.Iterable

public class FieldCollection 
extends java.lang.Object

A collection of Field objects that represents the fields in the specified range. An instance of this collection contains fields which starts fall within the specified range.

Property Getters/Setters Summary
intgetCount()
           Returns the number of the fields in the collection.
Fieldget(int index)
           Returns a field at the specified index.
 
Method Summary
voidclear()
           Removes all fields of this collection from the document and from this collection itself.
java.util.Iteratoriterator()
           Returns an enumerator object.
voidremove(Field field)
           Removes the specified field from this collection and from the document.
voidremoveAt(int index)
           Removes a field at the specified index from this collection and from the document.
 

Property Getters/Setters Detail

getCount

public int getCount()
Returns the number of the fields in the collection.

get

public Field get(int index)
Returns a field at the specified index.

The index is zero-based.

Negative indexes are allowed and indicate access from the back of the collection. For example -1 means the last item, -2 means the second before last and so on.

If index is greater than or equal to the number of items in the list, this returns a null reference.

If index is negative and its absolute value is greater than the number of items in the list, this returns a null reference.

Parameters:
index - An index into the collection.

Method Detail

clear

public void clear()
          throws java.lang.Exception
Removes all fields of this collection from the document and from this collection itself.

iterator

public java.util.Iterator iterator()
Returns an enumerator object.

remove

public void remove(Field field)
           throws java.lang.Exception
Removes the specified field from this collection and from the document.
Parameters:
field - A field to remove.

removeAt

public void removeAt(int index)
             throws java.lang.Exception
Removes a field at the specified index from this collection and from the document.
Parameters:
index - An index into the collection.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.