Class BookmarkDB

java.lang.Object
ghidra.program.database.DbObject
ghidra.program.database.bookmark.BookmarkDB
All Implemented Interfaces:
Bookmark, Comparable<Bookmark>

public class BookmarkDB extends DbObject implements Bookmark
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getId

      public long getId()
      Description copied from interface: Bookmark
      Returns the id of the bookmark.
      Specified by:
      getId in interface Bookmark
    • getAddress

      public Address getAddress()
      Description copied from interface: Bookmark
      Returns address at which this bookmark is applied.
      Specified by:
      getAddress in interface Bookmark
    • getType

      public BookmarkType getType()
      Description copied from interface: Bookmark
      Returns bookmark type object.
      Specified by:
      getType in interface Bookmark
    • getTypeString

      public String getTypeString()
      Description copied from interface: Bookmark
      Returns bookmark type as a string
      Specified by:
      getTypeString in interface Bookmark
    • getCategory

      public String getCategory()
      Description copied from interface: Bookmark
      Returns bookmark category
      Specified by:
      getCategory in interface Bookmark
    • setComment

      public void setComment(String comment)
    • getComment

      public String getComment()
      Description copied from interface: Bookmark
      Returns bookmark comment
      Specified by:
      getComment in interface Bookmark
    • set

      public void set(String category, String comment)
      Description copied from interface: Bookmark
      Set the category and comment associated with a bookmark.
      Specified by:
      set in interface Bookmark
      Parameters:
      category - category
      comment - single line comment
    • refresh

      protected boolean refresh(DBRecord rec)
      Description copied from class: DbObject
      Tells the object to refresh its state from the database using the specified record if provided. The record may be null and the object is generally expected to be able to retrieve its own record from the database as needed. Is is mostly passed as a parameter for efficiency to keep an object from having to look up its record when the client already has the record in hand such as when it is iterating over records.

      This method generally should not be called directly as it provides no recursion protection. Instead, most clients should call DbObject.refreshIfNeeded() instead which WILL provide recursion protection. If clients must call this method, they either need to provided their own recursion protection or be absolutely certain that recursive calls won't occur.

      Specified by:
      refresh in class DbObject
      Parameters:
      rec - valid record associated with object's key (optional, may be null to force record lookup or other refresh technique)
      Returns:
      true if the object was able to refresh itself. Return false if record is null and object was deleted. Objects that extend this class must implement a refresh method. If an object can never refresh itself, then it should always return false.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Bookmark otherBm)
      Specified by:
      compareTo in interface Comparable<Bookmark>
    • isOwnedBy

      public boolean isOwnedBy(BookmarkDBManager bookmarkDBManager)
    • checkDeleted

      public void checkDeleted()
      Description copied from class: DbObject
      Checks if this object has been deleted, in which case any use of the object is not allowed. This method should be invoked before any modifications to the object are performed to ensure it still exists and is in a valid state.
      Overrides:
      checkDeleted in class DbObject
    • isDeleted

      public boolean isDeleted()
      Description copied from interface: Bookmark
      Returns true if this bookmark has been deleted and is no longer valid..
      Specified by:
      isDeleted in interface Bookmark
      Returns:
      true if this bookmark has been deleted and is no longer valid.