public class FieldCollection
extends java.lang.Object
implements java.lang.Iterable
Field objects that represents the fields in the specified range.
An instance of this collection iterates fields which start fall within the specified range.
The FieldCollection collection does not own the fields it contains, rather, is just a selection of fields.
The FieldCollection collection is "live", i.e. changes to the children of the node object that it was created from are immediately reflected in the fields returned by the FieldCollection properties and methods.
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all fields of this collection from the document and from this collection itself.
|
Field |
get(int index)
Returns a field at the specified index.
|
int |
getCount()
Returns the number of the fields in the collection.
|
java.util.Iterator |
iterator()
Returns an enumerator object.
|
void |
remove(Field field)
Removes the specified field from this collection and from the document.
|
void |
removeAt(int index)
Removes a field at the specified index from this collection and from the document.
|
public int getCount()
public Field get(int 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.
index - An index into the collection.public void remove(Field field) throws java.lang.Exception
field - A field to remove.java.lang.Exceptionpublic void removeAt(int index)
throws java.lang.Exception
index - An index into the collection.java.lang.Exceptionpublic void clear()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterable