Class GarbageCollectionNotifier


  • public class GarbageCollectionNotifier
    extends java.lang.Object
    Provides a system for notifying when an object has been garbage collected. Normally using finalize on an object is sufficient, except when you are dealing with objects you can't subclass. e.g. Strings.
    Since:
    API 4.30 (Geneious 5.3.0)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void add​(java.lang.Object object, java.lang.Runnable runnable)
      Sets things up so that soon after this object is garbage collected, the given Runnable is invoked.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • add

        public static void add​(java.lang.Object object,
                               java.lang.Runnable runnable)
        Sets things up so that soon after this object is garbage collected, the given Runnable is invoked.
        Parameters:
        object - the object to watch for garbage collection
        runnable - the runnable to invoke soon after the object is garbage collected.