Package ghidra.plugin.importer

# Class ProjectIndexService

java.lang.Object
ghidra.plugin.importer.ProjectIndexService

All Implemented Interfaces:
  `DomainFolderChangeListener`, `AutoCloseable`

public class ProjectIndexService extends Object implements DomainFolderChangeListener, AutoCloseable
An in-memory index of FSRL-to-domainfiles.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `ProjectIndexService.IndexType`
  `static interface`
  `ProjectIndexService.ProjectIndexListener`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final ProjectIndexService`
  `DUMMY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProjectIndexService(Project project)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addIndexListener(ProjectIndexService.ProjectIndexListener listener)`
  `void`
  `close()`
  `void`
  `domainFileAdded(DomainFile file)`
  Notification that a file is added to parent folder.
  `void`
  `domainFileRemoved(DomainFolder parent, String name, String fileID)`
  Notification that a file was removed
  `DomainFile`
  `findFirstByFSRL(FSRL fsrl)`
  `static ProjectIndexService`
  `getIndexFor(Project project)`
  Returns an index for a Project.
  `List<DomainFile>`
  `lookupFiles(ProjectIndexService.IndexType keyType, Object keyValue)`
  `static void`
  `projectClosed(Project project)`
  Notify the index instance management that a Project has been closed.
  `void`
  `removeIndexListener(ProjectIndexService.ProjectIndexListener listener)`

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

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

  ### Methods inherited from interface ghidra.framework.model.DomainFolderChangeListener

  `domainFileMoved, domainFileObjectClosed, domainFileObjectOpenedForUpdate, domainFileRenamed, domainFileStatusChanged, domainFolderAdded, domainFolderMoved, domainFolderRemoved, domainFolderRenamed, domainFolderSetActive`

- ## Field Details

  - ### DUMMY

    public static final ProjectIndexService DUMMY

- ## Constructor Details

  - ### ProjectIndexService

    public ProjectIndexService(Project project)

- ## Method Details

  - ### getIndexFor

    public static ProjectIndexService getIndexFor(Project project)
    Returns an index for a Project. Instances returned by this method should not be `closed` by the caller.
    Parameters:
      `project` - `Project` to get index for, or `null` for a DUMMY placeholder
    Returns:
      `ProjectIndexService` instance, never null

  - ### projectClosed

    public static void projectClosed(Project project)
    Notify the index instance management that a Project has been closed. Users of this service need to do this because notification of Project closure is only available to GUI Plugin classes.
    Parameters:
      `project` - `Project` that was closed

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`

  - ### addIndexListener

    public void addIndexListener(ProjectIndexService.ProjectIndexListener listener)

  - ### removeIndexListener

    public void removeIndexListener(ProjectIndexService.ProjectIndexListener listener)

  - ### domainFileAdded

    public void domainFileAdded(DomainFile file)
    Description copied from interface: `DomainFolderChangeListener`
    Notification that a file is added to parent folder. You can get the parent from the file.
    Specified by:
      `domainFileAdded` in interface `DomainFolderChangeListener`
    Parameters:
      `file` - domain file which was just added.

  - ### domainFileRemoved

    public void domainFileRemoved(DomainFolder parent, String name, String fileID)
    Description copied from interface: `DomainFolderChangeListener`
    Notification that a file was removed
    Specified by:
      `domainFileRemoved` in interface `DomainFolderChangeListener`
    Parameters:
      `parent` - domain folder which contained the file that was just removed.
      `name` - the name of the file that was removed.
      `fileID` - file ID or null

  - ### lookupFiles

    public List<DomainFile> lookupFiles(ProjectIndexService.IndexType keyType, Object keyValue)

  - ### findFirstByFSRL

    public DomainFile findFirstByFSRL(FSRL fsrl)