java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.Nd

public final class Nd extends Object
Network Database for storing semantic information.
  • Field Details

    • sDEBUG_LOCKS

      public static boolean sDEBUG_LOCKS
    • DEBUG_DUPLICATE_DELETIONS

      public static boolean DEBUG_DUPLICATE_DELETIONS
    • db

      protected Database db
  • Constructor Details

  • Method Details

    • version

      public static int version(int major, int minor)
    • getDefaultVersion

      public int getDefaultVersion()
      Returns the version that shall be used when creating new databases.
    • isSupportedVersion

      public boolean isSupportedVersion(int vers)
    • getMinSupportedVersion

      public int getMinSupportedVersion()
    • getMaxSupportedVersion

      public int getMaxSupportedVersion()
    • versionString

      public static String versionString(int version)
    • getPath

      public File getPath()
    • getWriteNumber

      public long getWriteNumber()
    • scheduleDeletion

      public void scheduleDeletion(long addressOfNodeToDelete)
    • logDoubleDeletion

      protected void logDoubleDeletion(long addressOfNodeToDelete)
    • processDeletions

      public void processDeletions()
      Synchronously processes all pending deletions
    • setData

      public <T> void setData(Class<T> key, T value)
      Inserts a cookie that can be later retrieved via getData(String).
    • getData

      public <T> T getData(Class<T> key, Supplier<T> defaultValue)
      Returns a cookie that was previously attached using setData(Class, Object). If no such cookie exists, it is computed using the given function and remembered for later. The function may return null. If it does, this method will also return null and no cookie will be stored.
    • isPermanentlyReadOnly

      protected boolean isPermanentlyReadOnly()
      Returns whether this Nd can never be written to. Writable subclasses should return false.
    • getDB

      public Database getDB()
    • acquireReadLock

      public IReader acquireReadLock()
    • releaseReadLock

      public void releaseReadLock()
    • acquireWriteLock

      public void acquireWriteLock(org.eclipse.core.runtime.IProgressMonitor monitor)
      Acquire a write lock on this Nd. Blocks until any existing read/write locks are released.
      Throws:
      org.eclipse.core.runtime.OperationCanceledException
      IllegalStateException - if this Nd is not writable
    • acquireWriteLock

      public void acquireWriteLock(int giveupReadLocks, org.eclipse.core.runtime.IProgressMonitor monitor) throws InterruptedException
      Acquire a write lock on this Nd, giving up the specified number of read locks first. Blocks until any existing read/write locks are released.
      Throws:
      InterruptedException
      IllegalStateException - if this Nd is not writable
    • releaseWriteLock

      public final void releaseWriteLock()
    • releaseWriteLock

      public void releaseWriteLock(int establishReadLocks, boolean flush)
    • hasWaitingReaders

      public boolean hasWaitingReaders()
    • getLastWriteAccess

      public long getLastWriteAccess()
    • isSupportedVersion

      public boolean isSupportedVersion() throws IndexException
      Throws:
      IndexException
    • close

      public void close() throws IndexException
      Throws:
      IndexException
    • clearResultCache

      public void clearResultCache()
    • getCachedResult

      public Object getCachedResult(Object key)
    • putCachedResult

      public void putCachedResult(Object key, Object result)
    • putCachedResult

      public Object putCachedResult(Object key, Object result, boolean replace)
    • removeCachedResult

      public void removeCachedResult(Object key)
    • adjustThreadForReadLock

      public void adjustThreadForReadLock(Map<Thread,​org.aspectj.org.eclipse.jdt.internal.core.nd.Nd.DebugLockInfo> lockDebugging)
    • getNode

      public NdNode getNode(long address, short nodeType) throws IndexException
      Throws:
      IndexException
    • getTypeFactory

      public <T extends NdNode> ITypeFactory<T> getTypeFactory(short nodeType)
    • getNodeType

      public short getNodeType(Class<?> toQuery)
      Returns the type ID for the given class
    • delete

      public void delete(long address)
    • getTypeRegistry

      public NdNodeTypeRegistry<NdNode> getTypeRegistry()
    • clear

      public void clear(org.eclipse.core.runtime.IProgressMonitor monitor)
    • isValidAddress

      public boolean isValidAddress(long address)
    • describeProblem

      public IndexExceptionBuilder describeProblem()
      Creates a IndexExceptionBuilder object that collects information about database corruption after it is detected.