Class Bookmark

  • All Implemented Interfaces:
    java.lang.Comparable

    
    public class Bookmark
     implements Comparable<T>
                        

    Represents a bookmark in a PDF document.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      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.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getUuid() Returns UUID of this bookmark.
      Integer getPageIndex() Returns page index of the page this bookmark can point to.
      synchronized String getName() Returns a human-readable description of this bookmark.
      synchronized void setName(@Nullable() String name) Sets a human-readable description of this bookmark.
      synchronized Integer getSortKey() Returns an integer determining sort order for this bookmark.
      synchronized boolean isDirty() Returns true if this bookmark was changed since document was saved.
      synchronized void setSortKey(int sortKey) Sets an integer to determine bookmark sort order.
      synchronized void clearDirty() Marks bookmark not dirty.
      synchronized int compareTo(@Nullable() Bookmark bookmark)
      int hashCode()
      boolean equals(Object o)
      synchronized String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Bookmark

        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.
      • Bookmark

        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.
        pageIndex - 0-indexed page index to which this bookmark points to.
      • Bookmark

        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.
        name - Human readable name of the bookmark to be displayed in the UI.
        pageIndex - 0-indexed page index to which this bookmark points to.
    • Method Detail

      • getUuid

        @NonNull() String getUuid()

        Returns UUID of this bookmark.

        Returns:

        UUID of this bookmark.

      • getPageIndex

        @Nullable() 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.

      • getName

        @Nullable() synchronized String getName()

        Returns a human-readable description of this bookmark.

        Returns:

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

      • setName

         synchronized void setName(@Nullable() String name)

        Sets a human-readable description of this bookmark.

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

        @Nullable() 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.

      • isDirty

         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.

      • setSortKey

         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.
      • clearDirty

         synchronized void clearDirty()

        Marks bookmark not dirty.