Class SafeHandle

  • All Implemented Interfaces:
    AutoCloseable

    public class SafeHandle
    extends Object
    implements AutoCloseable
    Internal SafeHandle class Note: close() must be called in order to release underlying resources held by the object.
    • Constructor Detail

      • SafeHandle

        public SafeHandle​(long val,
                          SafeHandleType type)
        A safe handle that implements AutoCloseable
        Parameters:
        val - The value.
        type - the type
    • Method Detail

      • setValue

        public void setValue​(long newValue)
        Sets the long value
        Parameters:
        newValue - Long value to set.
      • getValue

        public long getValue()
        Gets the long value
        Returns:
        long value
      • close

        public void close()
        Dispose of associated resources. Note: close() must be called in order to release underlying resources held by the object.
        Specified by:
        close in interface AutoCloseable