Skip navigation links
com.heirloomcomputing.epli.runtime

Class Offset<T>

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int BYTES
      size in bytes if converted to a byte array
      static Offset<java.lang.Object> NULL
      an undefined OFFSET
      • Fields inherited from class com.heirloomcomputing.epli.runtime.Pointer

        model, ref
    • Constructor Summary

      Constructors 
      Constructor and Description
      Offset(T ref, Area inArea)
      Construct an Offset referencing another object in an area
    • Field Detail

      • BYTES

        public static final int BYTES
        size in bytes if converted to a byte array
        See Also:
        Constant Field Values
      • NULL

        public static final Offset<java.lang.Object> NULL
        an undefined OFFSET
    • Constructor Detail

      • Offset

        public Offset(T ref,
                      Area inArea)
        Construct an Offset referencing another object in an area
        Parameters:
        ref - - the reference to another object
        inArea - - the Area the Offset is within
    • Method Detail

      • free

        public void free()
        Invalidate the offset reference. Removing all references to an Area will cause the Java JVM to remove it
        Overrides:
        free in class Pointer<T>
      • free

        public void free(boolean ignore)
        Invalidate the offset reference ignoring invalid Offsets. Removing all references to an Area will cause the Java JVM to remove it
        Overrides:
        free in class Pointer<T>
        Parameters:
        ignore - - ignore any prior freed pointers (free() is a no-op)
      • toBytes

        public byte[] toBytes()
        turn a Pointer into a sequence of bytes
        Overrides:
        toBytes in class Pointer<T>
        Returns:
        byte array of the Pointer turned into a sequence of bytes
      • fromBytes

        public Pointer<T> fromBytes(byte[] bytes)
        turn a sequence of bytes into a Pointer
        Overrides:
        fromBytes in class Pointer<T>
        Parameters:
        bytes - - sequence of bytes representing a Pointer
        Returns:
        Pointer that was previously Remembered by toBytes()
        Throws:
        ERROR - CONDITION if the bytes don't represent a Pointer previously Remembered in this JVM