Class SoNodeDependencies

  • All Implemented Interfaces:
    SafeDisposable

    public class SoNodeDependencies
    extends Inventor
    implements SafeDisposable
    This class is a cache handler that can be used to monitor the modifications made to elements or fields. In order to add new Elements or Fields to be monitored by the cache, use the appropriate addDependency() method.

    If one of the added elements or fields has been modified since the last call to updateCache(), the isValid() method will return false, and a subsequent call to updateCache() will make it valid again.

    Additionnally, the handled cache can be manually invalidated using the invalidate() method.

    • Constructor Detail

      • SoNodeDependencies

        public SoNodeDependencies()
    • Method Detail

      • dispose

        public boolean dispose()
        Description copied from class: Inventor
        Explicitly call this method to force object to dispose its unmanaged resources. The object may not be reused in the application code after this call.
        Specified by:
        dispose in interface SafeDisposable
        Overrides:
        dispose in class Inventor
        Returns:
        true if this object native resources were successfully disposed; false if it was already disposed or no native resources has been registered for this object.
      • invalidate

        public void invalidate()
        Manually invalidate the cache.
      • addDependency

        public void addDependency​(java.lang.Class<? extends Inventor> type,
                                  int classStackIndex)
        Add given element type as a dependency for the cache.
      • updateCache

        public void updateCache​(SoState state)
        Update cache according to given state. After this call, the cache will be valid.
      • isValid

        public boolean isValid​(SoState state)
        Returns true if the cache is valid for the given state.