public class

Bookmark

extends Object
implements Comparable<T>
java.lang.Object
   ↳ com.pspdfkit.bookmarks.Bookmark

Class Overview

Represents a bookmark in a PDF document.

Summary

Public Constructors
Bookmark(int pageIndex)
Creates a new bookmark pointing to a page with generated UUID.
Bookmark(String name, int pageIndex)
Creates a new bookmark pointing to a page with generated UUID.
Bookmark(String uuid, String name, int pageIndex)
Creates a new bookmark pointing to a page.
Public Methods
synchronized void clearDirty()
Marks bookmark not dirty.
synchronized int compareTo(Bookmark bookmark)
boolean equals(Object o)
synchronized String getName()
Returns a human-readable description of this bookmark.
Integer getPageIndex()
Returns page index of the page this bookmark can point to.
synchronized Integer getSortKey()
Returns an integer determining sort order for this bookmark.
String getUuid()
Returns UUID of this bookmark.
int hashCode()
synchronized boolean isDirty()
Returns true if this bookmark was changed since document was saved.
synchronized void setName(String name)
Sets a human-readable description of this bookmark.
synchronized void setSortKey(int sortKey)
Sets an integer to determine bookmark sort order.
synchronized String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Comparable

Public Constructors

public Bookmark (int pageIndex)

Creates a new bookmark pointing to a page with generated UUID.

Parameters
pageIndex 0-indexed page index to which this bookmark points to.

public Bookmark (String name, int pageIndex)

Creates a new bookmark pointing to a page with generated UUID.

Parameters
name Human readable name of the bookmark to be displayed in the UI. May be null.
pageIndex 0-indexed page index to which this bookmark points to.

public Bookmark (String uuid, String name, int pageIndex)

Creates a new bookmark pointing to a page.

Parameters
uuid Unique ID of the bookmark in the document. A document cannot contain multiple bookmarks with the same UUID.
name Human readable name of the bookmark to be displayed in the UI. May be null.
pageIndex 0-indexed page index to which this bookmark points to.

Public Methods

public synchronized void clearDirty ()

Marks bookmark not dirty.

public synchronized int compareTo (Bookmark bookmark)

public boolean equals (Object o)

public synchronized String getName ()

Returns a human-readable description of this bookmark.

Returns
  • A human-readable description or null if there is none.

public Integer getPageIndex ()

Returns page index of the page this bookmark can point to. For stored bookmarks which don't have a page target this returns null.

Returns
  • Page to which this bookmark points or null if it has a non-page target.

public synchronized Integer getSortKey ()

Returns an integer determining sort order for this bookmark. Can be null.

Returns
  • Integer determining sort order or null if none is set.

public String getUuid ()

Returns UUID of this bookmark.

Returns
  • UUID of this bookmark.

public int hashCode ()

public synchronized boolean isDirty ()

Returns true if this bookmark was changed since document was saved.

Returns
  • true if the bookmark was modified, false if it wasn't.

public synchronized void setName (String name)

Sets a human-readable description of this bookmark.

Parameters
name A human-readable description or null to set none.

public synchronized void setSortKey (int sortKey)

Sets an integer to determine bookmark sort order. If none is set, page number is used for sorting.

Parameters
sortKey Integer to determine sort order.

public synchronized String toString ()