Class FieldSearchKey<T>

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.field.FieldSearchKey<T>
All Implemented Interfaces:
IDestructableField, IField

public class FieldSearchKey<T> extends Object implements IDestructableField
Represents a search key into a global search index.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T,​ B extends NdNode>
    FieldSearchKey<T>
    create​(StructDef<B> builder, FieldSearchIndex<B> searchIndex)
    Creates a search key attribute in the given struct which stores an entry in the given global search index
    void
    destruct​(Nd nd, long address)
     
    get​(Nd nd, long address)
     
    Returns the name of the field.
    int
    Returns the field offset, in bytes from the start of the struct.
    int
    Returns the size of the field, in bytes.
    boolean
    isInIndex​(Nd nd, long address)
    Returns true iff this key is currently in the index
    void
    put​(Nd nd, long address, char[] newString)
    Sets the value of the key and inserts it into the index if it is not already present
    void
    put​(Nd nd, long address, String newString)
     
    void
    removeFromIndex​(Nd nd, long address)
    Clears this key and removes it from the search index
    protected void
    setFieldName​(String fieldName)
     
    void
    setOffset​(int offset)
    Sets the field offset (bytes from the start of the struct).

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.aspectj.org.eclipse.jdt.internal.core.nd.field.IField

    getAlignment
  • Field Details

    • offset

      protected int offset
  • Method Details

    • create

      public static <T,​ B extends NdNode> FieldSearchKey<T> create(StructDef<B> builder, FieldSearchIndex<B> searchIndex)
      Creates a search key attribute in the given struct which stores an entry in the given global search index
    • put

      public void put(Nd nd, long address, String newString)
    • put

      public void put(Nd nd, long address, char[] newString)
      Sets the value of the key and inserts it into the index if it is not already present
    • get

      public IString get(Nd nd, long address)
    • destruct

      public void destruct(Nd nd, long address)
      Specified by:
      destruct in interface IDestructableField
    • removeFromIndex

      public void removeFromIndex(Nd nd, long address)
      Clears this key and removes it from the search index
    • isInIndex

      public boolean isInIndex(Nd nd, long address)
      Returns true iff this key is currently in the index
    • getRecordSize

      public int getRecordSize()
      Description copied from interface: IField
      Returns the size of the field, in bytes.
      Specified by:
      getRecordSize in interface IField
    • setFieldName

      protected final void setFieldName(String fieldName)
    • setOffset

      public final void setOffset(int offset)
      Description copied from interface: IField
      Sets the field offset (bytes from the start of the struct). This is invoked some time after field construction, after the sizes of all preceeding fields are known.
      Specified by:
      setOffset in interface IField
    • getOffset

      public final int getOffset()
      Description copied from interface: IField
      Returns the field offset, in bytes from the start of the struct.
      Specified by:
      getOffset in interface IField
    • getFieldName

      public final String getFieldName()
      Description copied from interface: IField
      Returns the name of the field. This is mainly used for error messages, debug output, and diagnostic tools. Meant to be programmer-readable but not user-readable.
      Specified by:
      getFieldName in interface IField