Class FieldOneToOne<T extends INdStruct>

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

public class FieldOneToOne<T extends INdStruct> extends Object implements IDestructableField, IRefCountedField
Represents a 1-to-0..1 relationship in a Nd database.
  • Field Details

    • nodeType

      public final StructDef<T extends INdStruct> nodeType
    • offset

      protected int offset
  • Method Details

    • create

      public static <T extends INdStruct,​ B extends INdStruct> FieldOneToOne<T> create(StructDef<B> builder, StructDef<T> nodeType, FieldOneToOne<B> forwardPointer)
    • createOwner

      public static <T extends INdStruct,​ B extends INdStruct> FieldOneToOne<T> createOwner(StructDef<B> builder, StructDef<T> nodeType, FieldOneToOne<B> forwardPointer)
    • get

      public T get(Nd nd, long address)
    • put

      public void put(Nd nd, long address, T target)
    • destruct

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

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

      public boolean hasReferences(Nd nd, long address)
      Description copied from interface: IRefCountedField
      Returns true if this field knows of any remaining incoming references to this object. This is used by the implementation of FieldManyToOne to determine whether or not a refcounted object should be deleted after a reference is removed.

      Implementations should return false if the refcount is 0 or true if the refcount is nonzero.

      Specified by:
      hasReferences in interface IRefCountedField
    • 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