java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.NdStruct
org.aspectj.org.eclipse.jdt.internal.core.nd.NdNode
All Implemented Interfaces:
IDestructable, INdStruct
Direct Known Subclasses:
NdBinding, NdConstant, NdMethodAnnotationData, NdResourceFile, NdTypeArgument, NdTypeInterface, NdTypeSignature, NdWorkspaceLocation

public abstract class NdNode extends NdStruct implements IDestructable
This is a basic polymorphic node in the network database. Pointers to NdNode or any of their subclasses will be resolved to the correct subclass of NdNode such that the correct version of an overloaded method will be invoked.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static FieldShort
     
     

    Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.NdStruct

    address, nd
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    NdNode​(Nd nd)
     
    protected
    NdNode​(Nd nd, long address)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invokes the destructor on this node and frees up its memory
    void
    Dispose this NdNode.
    boolean
    equals​(Object obj)
     
    long
    Returns the database address at which the struct begins.
    long
     
    protected static boolean
    getBit​(int bitVector, int offset)
    Returns the bit at the specified offset in a bit vector.
    protected byte
    getByte​(long offset)
    Convenience method for fetching a byte from the database.
    static int
    getNodeId​(int linkageID, int nodeType)
    Return an value to globally identify the given node within the given linkage.
    short
    Return a value to uniquely identify the node within the factory that is responsible for loading instances of this node from the Nd.
    int
     
    static NdNode
    load​(Nd nd, long address)
    Load a node from the specified address in the given database.
    static <T extends INdStruct>
    T
    load​(Nd nd, long address, StructDef<T> typeToLoad)
     

    Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.nd.NdStruct

    getDB, getNd

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • NdNode

      protected NdNode(Nd nd, long address)
    • NdNode

      protected NdNode(Nd nd)
  • Method Details

    • load

      public static NdNode load(Nd nd, long address)
      Load a node from the specified address in the given database. Return null if a node cannot be loaded.
      Parameters:
      nd - The Nd from which to load the node.
      address - The address of the node in the given Nd.
      Returns:
      The NdNode at the specified location or null if a node cannot be loaded.
    • load

      public static <T extends INdStruct> T load(Nd nd, long address, StructDef<T> typeToLoad)
    • delete

      public final void delete()
      Invokes the destructor on this node and frees up its memory
    • getNodeType

      public short getNodeType()
      Return a value to uniquely identify the node within the factory that is responsible for loading instances of this node from the Nd.
    • getAddress

      public final long getAddress()
      Description copied from interface: INdStruct
      Returns the database address at which the struct begins.
      Specified by:
      getAddress in interface INdStruct
      Overrides:
      getAddress in class NdStruct
    • getBindingID

      public final long getBindingID()
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • getNodeId

      public static int getNodeId(int linkageID, int nodeType)
      Return an value to globally identify the given node within the given linkage. This value can be used for comparison with other NdNodes.
    • getByte

      protected byte getByte(long offset)
      Convenience method for fetching a byte from the database.
      Parameters:
      offset - Location of the byte.
      Returns:
      a byte from the database.
    • getBit

      protected static boolean getBit(int bitVector, int offset)
      Returns the bit at the specified offset in a bit vector.
      Parameters:
      bitVector - Bits.
      offset - The position of the desired bit.
      Returns:
      the bit at the specified offset.
    • destruct

      public void destruct()
      Dispose this NdNode. Subclasses should extend this method to perform any high-level node-specific cleanup. This will be invoked prior to disposing the fields. Implementations must invoke their parent's destruct method and should not destruct the fields.

      If an external object wants to destroy a node, they should invoke delete() rather than this method.

      Specified by:
      destruct in interface IDestructable