Package ghidra.program.database.function

# Class FunctionTagManagerDB

java.lang.Object
ghidra.program.database.function.FunctionTagManagerDB

All Implemented Interfaces:
  `ErrorHandler`, `FunctionTagManager`

public class FunctionTagManagerDB extends Object implements FunctionTagManager, ErrorHandler

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Lock`
  `lock`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FunctionTag`
  `createFunctionTag(String name, String comment)`
  Creates a new function tag with the given attributes if one does not already exist.
  `void`
  `dbError(IOException e)`
  Notification that an IO exception occurred.
  `List<? extends FunctionTag>`
  `getAllFunctionTags()`
  Returns all function tags in the database
  `FunctionTag`
  `getFunctionTag(long id)`
  Returns the function tag with the given database id
  `FunctionTag`
  `getFunctionTag(String name)`
  Returns the function tag with the given name
  `DBRecord`
  `getTagRecord(long id)`
  `int`
  `getUseCount(FunctionTag tag)`
  Returns the number of times the given tag has been applied to a function
  `boolean`
  `isTagAssigned(String name)`
  Returns true if the given tag is assigned to a function
  `void`
  `setProgram(Program program)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### lock

    protected final Lock lock

- ## Method Details

  - ### setProgram

    public void setProgram(Program program)

  - ### dbError

    public void dbError(IOException e)
    Description copied from interface: `ErrorHandler`
    Notification that an IO exception occurred.
    Specified by:
      `dbError` in interface `ErrorHandler`
    Parameters:
      `e` - `IOException` which was cause of error

  - ### getFunctionTag

    public FunctionTag getFunctionTag(String name)
    Description copied from interface: `FunctionTagManager`
    Returns the function tag with the given name
    Specified by:
      `getFunctionTag` in interface `FunctionTagManager`
    Parameters:
      `name` - the tag name
    Returns:
      the function tag, or null if not found

  - ### getFunctionTag

    public FunctionTag getFunctionTag(long id)
    Description copied from interface: `FunctionTagManager`
    Returns the function tag with the given database id
    Specified by:
      `getFunctionTag` in interface `FunctionTagManager`
    Parameters:
      `id` - the tags database id
    Returns:
      the function tag, or null if not found

  - ### isTagAssigned

    public boolean isTagAssigned(String name)
    Description copied from interface: `FunctionTagManager`
    Returns true if the given tag is assigned to a function
    Specified by:
      `isTagAssigned` in interface `FunctionTagManager`
    Parameters:
      `name` - the tag name
    Returns:
      true if assigned to a function

  - ### createFunctionTag

    public FunctionTag createFunctionTag(String name, String comment)
    Description copied from interface: `FunctionTagManager`
    Creates a new function tag with the given attributes if one does not already exist. Otherwise, returns the existing tag.
    Specified by:
      `createFunctionTag` in interface `FunctionTagManager`
    Parameters:
      `name` - the tag name
      `comment` - the comment associated with the tag (optional)
    Returns:
      the new function tag

  - ### getAllFunctionTags

    public List<? extends FunctionTag> getAllFunctionTags()
    Description copied from interface: `FunctionTagManager`
    Returns all function tags in the database
    Specified by:
      `getAllFunctionTags` in interface `FunctionTagManager`
    Returns:
      list of function tags

  - ### getTagRecord

    public DBRecord getTagRecord(long id) throws IOException
    Throws:
      `IOException`

  - ### getUseCount

    public int getUseCount(FunctionTag tag)
    Description copied from interface: `FunctionTagManager`
    Returns the number of times the given tag has been applied to a function
    Specified by:
      `getUseCount` in interface `FunctionTagManager`
    Parameters:
      `tag` - the tag
    Returns:
      the count