java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.index.Index

public class Index extends Object
An Index maps document names to their referenced words in various categories.

Queries can search a single category or several at the same time.

Indexes are not synchronized structures and should only be queried/updated one at a time.
  • Field Details

    • containerPath

      public String containerPath
    • monitor

      public volatile ReadWriteMonitor monitor
    • separator

      public char separator
    • diskIndex

      protected DiskIndex diskIndex
    • memoryIndex

      protected MemoryIndex memoryIndex
  • Constructor Details

  • Method Details

    • isMatch

      public static boolean isMatch(char[] pattern, char[] word, int matchRule)
    • addIndexEntry

      public void addIndexEntry(char[] category, char[] key, String containerRelativePath)
    • containerRelativePath

      public String containerRelativePath(String documentPath)
    • getIndexFile

      public File getIndexFile()
    • getIndexLocation

      public IndexLocation getIndexLocation()
    • getIndexLastModified

      public long getIndexLastModified()
    • hasChanged

      public boolean hasChanged()
    • query

      public EntryResult[] query(char[][] categories, char[] key, int matchRule) throws IOException
      Returns the entries containing the given key in a group of categories, or null if no matches are found. The matchRule dictates whether its an exact, prefix or pattern match, as well as case sensitive or insensitive. If the key is null then all entries in specified categories are returned.
      Throws:
      IOException
    • queryDocumentNames

      public String[] queryDocumentNames(String substring) throws IOException
      Returns the document names that contain the given substring, if null then returns all of them.
      Throws:
      IOException
    • remove

      public void remove(String containerRelativePath)
    • reset

      public void reset() throws IOException
      Reset memory and disk indexes.
      Throws:
      IOException
    • save

      public void save() throws IOException
      Throws:
      IOException
    • startQuery

      public void startQuery()
    • stopQuery

      public void stopQuery()
    • toString

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

      public boolean isIndexForJar()
    • getMetaIndexQualifications

      public List<IndexQualifier> getMetaIndexQualifications() throws IOException
      Throws:
      IOException