public class BookmarkCollection
extends java.lang.Object
implements java.lang.Iterable
Bookmark objects that represent the bookmarks in the specified range.
To learn more, visit the Working with Bookmarks documentation article.
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all bookmarks from this collection and from the document.
|
Bookmark |
get(int index)
Returns a bookmark at the specified index.
|
Bookmark |
get(java.lang.String bookmarkName)
Returns a bookmark by name.
|
int |
getCount()
Returns the number of bookmarks in the collection.
|
java.util.Iterator |
iterator()
Returns an enumerator object.
|
void |
remove(Bookmark bookmark)
Removes the specified bookmark from the document.
|
void |
remove(java.lang.String bookmarkName)
Removes a bookmark with the specified name.
|
void |
removeAt(int index)
Removes a bookmark at the specified index.
|
public int getCount()
public Bookmark 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 Bookmark get(java.lang.String bookmarkName)
Returns null if the bookmark with the specified name cannot be found.
bookmarkName - Case-insensitive name of the bookmark.public void remove(Bookmark bookmark) throws java.lang.Exception
bookmark - The bookmark to remove.java.lang.Exceptionpublic void remove(java.lang.String bookmarkName)
throws java.lang.Exception
bookmarkName - The case-insensitive name of the bookmark to remove.java.lang.Exceptionpublic void removeAt(int index)
throws java.lang.Exception
index - The zero-based index of the bookmark to remove.java.lang.Exceptionpublic void clear()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterable